0

I want to edit meta-tags of a blog page of my WordPress blog using SQL editting tool such as MySQL workbench.

I want SQL output such as below. Can not?

# post_title, metatag
'metadev', 'hoge'
'metadev', 'fuga'

SELECT * FROM yuis_yuisorgblog.wp_posts;

Output of above SQL is below.

# ID, post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count
'164', '1', '2018-08-20 15:49:53', '2018-08-20 06:49:53', '<p>metatagdev</p>\n', 'metatagdev', '', 'publish', 'closed', 'open', '', 'metatagdev', '', '', '2018-08-20 15:49:53', '2018-08-20 06:49:53', 'metatagdev', '0', 'http://yuis.org/blog/?p=164', '0', 'post', '', '0'

SELECT * FROM yuis_yuisorgblog.wp_term_relationships;

Output of above SQL is below.

# object_id, term_taxonomy_id, term_order
'164', '5', '0'
'164', '6', '0'

SELECT * FROM yuis_yuisorgblog.wp_term_taxonomy;

Output of above SQL is below.

# term_taxonomy_id, term_id, taxonomy, description, parent, count
'5', '5', 'post_tag', '', '0', '1'
'6', '6', 'post_tag', '', '0', '1'

SELECT * FROM yuis_yuisorgblog.wp_terms;

Output of above SQL is below.

# term_id, name, slug, term_group
'5', 'hoge', 'hoge', '0'
'6', 'fuga', 'fuga', '0'
0
SELECT post_title,name 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'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.