Nuxt 3 SEO meta tags with WordPress API
Автор: codingoblin
Загружено: 2023-07-29
Просмотров: 1106
Описание:
Written instructions including all code: https://codingoblin.com/seo-meta-tags...
How to get SEO meta tags into a Nuxt.js application when using the WordPress REST API as a backend.
In this guide we will make use of the powerful Yoast SEO WordPress plugin, to create our meta data in out WordPress backend. We can then view this meta data by checking the endpoint for our page and post to see the "yoast_head_json" object within our data object. This yoast_head_json object contains all of the meta data for our page.
We can get the page data from out WordPress REST API, into our Nuxt.js application, using the useFetch() function. Once we have the data object in our Nuxt.js project we can use the useServerSeoMeta() Nuxt function. With this function we can associate the relevant properties from yoast_head_json with each meta tag that we want to output into Nuxt. In our example we will output the title tag, description meta tag, og:url meta tag, og:title meta tag, og:description meta tag, og:image meta tag, og:type meta tag, og:locale meta tag, twitter:card meta tag, twitter:title meta tag, twitter:description meta tag and twitter:image meta tag.
Deciding which meta tags to use is a personal choice. As there are a lot of meta tags to choose from.
Other Nuxt.js functions that can be used are useHead() , use
My Hosting Provider - use code GOBLIN for a discount. Free trial with no card required:
https://platform.cloudways.com/signup...
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: