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!
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!
- Stay tuned Keep an eye on our site and social media to stay up-to-date. See where you can find us next »
- SEO webinar 20 December 2022 Our head of SEO, Jono Alderson, will keep you up-to-date about everything that happens in the world of SEO and WordPress. All Yoast SEO webinars »