Comeau Software Solutions

Making sense of technology since 2000.

Menu
  • Home / Updates
  • Services / Contact Us
  • Rogue C# Project Page
  • More Resources
    • Join Ocala’s Tech Community!
    • YouTube Channel
    • Personal Site
Menu

Importing Meta Descriptions to Yoast SEO

Posted on January 1, 2015December 27, 2022 by Andrew Comeau

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.


9 thoughts on “Importing Meta Descriptions to Yoast SEO”

  1. Sebastian says:
    April 11, 2015 at 3:54 am

    thanks for this post. Meta description are important to get higher click through rate for search engine campaigns

  2. Tabby says:
    May 11, 2015 at 11:57 pm

    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.

  3. Julius says:
    October 24, 2015 at 7:13 am

    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?

  4. Myriad Media says:
    March 27, 2017 at 10:13 am

    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??

  5. Mazepress says:
    June 24, 2017 at 4:02 pm

    Hi, thanks for this, I was doing something similar but have one issue, I can’t seem to use these same fields to import Yoast data to custom taxonomy terms, like categories etc. Do those terms differ? Appreciate any ideas you can share. Thanks

  6. macsai says:
    July 25, 2017 at 7:06 am

    Hi ,
    I’m using Yoast plugin and I want to import all title and meta,What will be SQL query for searching title and meta tags please.

  7. Petar says:
    November 8, 2017 at 5:33 am

    Hi,

    Thanks for this knowledgeable post, but i want to i am using yoast plugin and my website in woocommrce
    i need to change my service price at once is it possible ?

    Regards
    Petar

  8. Dewald Swart says:
    October 30, 2019 at 4:21 am

    Awesome I was wondering thoug if it is possible to edit meta titles traignt in the db?

    1. Andrew Comeau says:
      December 2, 2019 at 5:40 pm

      Probably – you’d just have to find the right table and field. I’d be cautious and just edit one or two at a time to start with.

Comments are closed.

ComeauSoftware.com provides learning resources, including tutorials and videos, to guide you in understanding today's technology. Please check out our YouTube channel and bookmark this site to stay informed of upcoming projects.

Comeau Software Solutions also provides software consultation, including the development of database solutions, in Ocala, Florida. This includes rescuing Microsoft Access database projects and assistance in move to other solutions. Please contact us for more information on how we can help you with your project needs.

Available on Amazon.com


T-SQL Fundamentals, 4th Edition


Itzik Ben-Gan
  • Articles
  • C#
  • Careers
  • Commentary
  • Database Design
  • Databases
  • Hardware
  • How-to
  • Humor
  • Internet
  • Jobs
  • Linux
  • Microsoft Access
  • MySQL
  • Ocala I.T. Professionals
  • Personal
  • Personal Tech
  • Programming
  • Resources
  • Reviews
  • Rogue C# Series
  • Software
  • SQL
  • Uncategorized
  • Web Design
  • Writing
©2023 Comeau Software Solutions | Theme by SuperbThemes