MySQL queries cheatsheet for WordPress

Changing from http to https in wp_posts.post_content and wp_posts.guid

UPDATE wordpress_db.wp_posts
SET post_content = REPLACE(post_content, 'http://domain.com', 'https://domain.com')
WHERE post_content LIKE '%http://domain.com%';

UPDATE wordpress_db.wp_posts
SET guid = REPLACE(guid, 'http://domain.com', 'https://domain.com')
WHERE guid LIKE '%http://domain.com%';

Leave a Reply