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!
- Event December 09, 2023 Team Yoast is at Attending, Organizing, Sponsoring WordCamp Ahmedabad 2023! Click through to see who will be there, what we will do, and more! See where you can find us next »
- SEO webinar 12 December 2023 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 »