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.



C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals: Start building websites and services with ASP.NET Core 9, Blazor, and EF Core 9
  • Explore the newest additions to C# 13, the .NET 9 class libraries, and Entity Framework Core 9
  • Build professional websites and services with ASP.NET Core 9 and Blazor
  • Enhance your skills with step-by-step code examples and best practices tips
ComeauSoftware.com uses affiliate links through which we earn commissions for sales.

Sign up for our newsletter to receive updates about new projects, including the upcoming book "Self-Guided SQL"!

We respect your privacy and will never share your information with third-parties. See our privacy policy for more information.

×