skip to Main Content

I’m managing a small directory website and I have set some generic titles and descriptions for my pages with Yoast SEO Plugin.

enter image description here

I’d like to duplicate them to every entry/page directly via the MySQL database. However, I cannot find it in the DB.

I didn’t find it in wp_postmeta, wp_posts or wp_yoast_seo_meta.

That’s why I ask: where does Yoast (v. 7.8) store the SEO informations that a user set?

4

Answers


  1. Chosen as BEST ANSWER

    So after some time, I figured out that the best way to find out where this data where stored was to dump the DB and look in that dump:

    mysqldump -u wordpress --no-create-info --extended-insert=FALSE wordpress -p > dumpydump.sql
    cat dumpydump.sql | grep "What you're looking for"
    

    What you'll find is an row called wpseo_taxonomy_meta in table wp_options which contains every taxonomy SEO texts. It is saved as a PHP serialised value.

    Be careful though that this is just for the SEO texts of the Taxonomies (e.g. Location, Feature, Category...). It doesn't apply to the SEO descriptions and titles of the posts themselves (these are stored in wp_postmeta with at least one row per post).


  2. just use this code, you’ll get an array of all settings that Yeast SEO show under “Search Appearance” page. Including title, descriptions and all other settings.

    $wpseo_search =get_option( 'wpseo_titles', $default = false );
    

    Update your required field and save using the update_option() function of WordPress.

    Login or Signup to reply.
  3. Yoast SEO Save Description and Keywords in wp_yoast_indexable Table. Where you can see column name description and keywords

    Login or Signup to reply.
  4. You can use this (for categories):

    $wpseo_options = get_option( 'wpseo_taxonomy_meta');
    $wpseo_options['category'][<the_category_id>]['wpseo_title'] = '... my title';
    $wpseo_options['category'][<the_category_id>]['wpseo_desc'] = '... my description';
    update_option('wpseo_taxonomy_meta', $wpseo_options, true);
    

    It should work. Also, you should check the wp_yoast_indexable table for correct recordings.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search