This article introduces how to check and edit meta tags and meta keywords for WordPress posts in SQL.

Iโm using mysql workbench as the MySQL client.
The relationships are a bit complex.
USE yuis_yuisorgblog ; # Database name
SELECT ID,post_title,post_status,name,term_id FROM wp_posts
JOIN wp_term_relationships ON wp_term_relationships.object_id = wp_posts.ID
JOIN wp_terms ON wp_terms.term_id = wp_term_relationships.term_taxonomy_id
WHERE post_type = 'post'
AND post_title REGEXP "."
order by post_date desc
;
With the AND post_title REGEXP โ.โ part, you can also filter titles with regular expressions.
In workbench, the result of such complex selects is read only, meaning they cannot be edited. So, based on this result, we do another select and edit that.
Referring to the term_id column in the previous screen, write the IDs of tags you want to edit separated by | and execute the SQL.
SELECT * FROM wp_terms where term_id REGEXP "1|5|6" ;

So, we were able to check and edit meta tags,
Unfortunately, adding/deleting meta tags is also difficult, and Iโm struggling with it.