Yoast SEO 14.0: WP CLI index command
We have added a WP CLI command to Yoast SEO 14.0. In Yoast SEO 14.0 we created new tables in which we combine all the metadata for indexable objects on a site. Please see Omar’s post for the reasoning behind this. Regardless of whether you’re using Yoast SEO in the conventional way or through the new headless functionality, this works the best and the fastest if your site’s meta data is fully indexed. You can make sure of that by running our WP CLI command!
If you’re using our REST API or our surfaces, running this CLI command on your site before going into production with those is very important.
Syntax
The syntax for this WP CLI command is very simple:
wp yoast index
The output will look something like this:
Indexing posts 100% [==============================] 0:00 / 0:00 Indexing terms 100% [==============================] 0:00 / 0:00 Indexing post type archives 100% [=================] 0:00 / 0:00 Indexing general objects 100% [====================] 0:00 / 0:00
If one of these doesn’t show that is because all of the items in there were already indexed. Authors are indexed as part of the posts
indexation process. If you want to test this index
command multiple times, please use the Yoast Test Helper. If you hit the “Reset Indexables tables & migrations” button in that plugin, it’ll delete the Indexables tables. After that you can run the process again.
Potential Yoast SEO WP CLI errors
You might get this error:
Error: 'index' is not a registered subcommand of 'yoast'. See 'wp help yoast' for available subcommands.
This means you’re not on the correct version of Yoast SEO. Please note that you need to be on Yoast SEO 14.0 or higher for the Yoast SEO WP CLI command index
to work.
Questions? Let us know in the comments!
Coming up next!
-
Event
WordCamp Netherlands 2024
November 29 - 30, 2024 Team Yoast is at Sponsoring WordCamp Netherlands 2024! Click through to see who will be there, what we will do, and more! See where you can find us next » -
SEO webinar
Webinar: How to start with SEO (November 19, 2024)
19 November 2024 Learn how to start your SEO journey the right way with our free webinar. Get practical tips and answers to all your questions in the live Q&A! All Yoast SEO webinars »
21 Responses to Yoast SEO 14.0: WP CLI index command