6

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?

Machavity
  • 30,841
  • 27
  • 92
  • 100
Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57
  • 1
    You might want to ask this on [Wordpress.SE](//wordpress.stackexchange.com), as you're more likely to get an answer – Machavity Aug 14 '18 at 17:49

4 Answers4

6

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).

Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57
2

Yoast SEO Save Description and Keywords in wp_yoast_indexable Table. Where you can see column name description and keywords

Laurent Meyer
  • 2,766
  • 3
  • 33
  • 57
Hashaam zahid
  • 315
  • 5
  • 21
0

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.

Umair Idrees
  • 1,380
  • 1
  • 10
  • 6
0

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.