Importing Meta Descriptions to Yoast SEO

In a recent post, I talked about using the WordPress plugin Add Meta Tags for adding meta descriptions and titles to posts and pages within my WordPress sites. It’s a simple SEO tool but works well. Nevertheless, I decided to switch my sites over to Yoast SEO for all its extra features and guidance in constructing pages. I was anticipating quite a job as this blog alone has almost 100 posts and all of those descriptions needed to be transferred from the fields created by the old plugin to Yoast’s fields. Yoast does have some import tools of its own but they didn’t include the one I’d been using and my experience with a third-party converter had not been good so I was glad to find that I could do it so simply with one query in phpMyAdmin.

The meta descriptions and other information for posts and pages are stored in the wp_postmeta table in the WordPress database. (Click for larger image.)

The meta descriptions and other information for posts and pages are stored in the wp_postmeta table in the WordPress database. (Click for larger image.)

The meta descriptions generated by both the Add Meta Data and Yoast plugins are stored in the wp_postmeta table in the WordPress database. This table stores key / value pairs for information related to the individual items with the post_id field identifying the specific post or page and the meta_id field acting as a table key. Yoast stores it’s meta descriptions under the key “_yoast_wpseo_metadesc” and Add Meta Data stored its descriptions as “_amt_description”. I was able to verify this by looking for the values in the few posts that I had manually converted.

A single SQL query was able to change all the description records for the previous plugin to use Yoast’s key title.

UPDATE <database name>.wp_postmeta
SET meta_key = '_yoast_wpseo_metadesc'
WHERE meta_key = '_amt_description'

Yoast does have a setting to use meta keywords but I’m not using them this time around so the description was really the only thing to be moved over. Yoast had automatically converted the titles from the Post titles. Within an hour I had converted both sites and removed the old plugin completely while retaining all of my meta descriptions.

A quick SQL query converted all of the meta descriptions from the previous SEO plugin to Yoast.

A quick SQL query converted all of the meta descriptions from the previous SEO plugin to Yoast. (Click for larger image.)

You should be familiar with either phpMyAdmin or MySQL Workbench before doing this and you should understand the basics of SQL. If you do decide to try this BE SURE TO BACKUP YOUR SITE FIRST and double-check your SQL queries before running them. Even though I’d done a recent backup, I paused a second or two before clicking the Go button.


Do you need help with the search engine performance for your website? See my professional site at ComeauSoftware.com for more information on how I can help you with your website and other technology questions.

If you would like to learn more about Structured Query Language (SQL), check out my book Your First Guide to Database Design, available on Amazon.com.

Available on Amazon.com


SanDisk 32GB Class 4 SDHC Memory Card
SanDisk

4 thoughts on “Importing Meta Descriptions to Yoast SEO

  1. Tabby

    Sebastian is right, meta descriptions now play a more vital role in SEO campaigns especially if you’re after CTRs. Every SEO-favoring WordPress user should learn this.

    Reply
  2. Julius

    How could I call _yoast_wpseo_metadesc in my Category archive page? I need to call category description, but not the one which is in default wordpress but the one I set in SEO Category Description in Yoast SEO plugin?

    Reply
  3. Myriad Media

    We have a development version of our website that has Yoast installed but doesn’t have all the titles and descriptions added to the products like the Live version of the site does. Would this method work to copy these from Live site to the Dev one??

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *