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 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.
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.
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.
thanks for this post. Meta description are important to get higher click through rate for search engine campaigns
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.
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?
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??
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
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.
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
Awesome I was wondering thoug if it is possible to edit meta titles traignt in the db?
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.