How to Replace Old Domain URL in wp_posts Table

I migrated my WordPress website to new domain, so I need to update all image URLs in wp_posts, wp_postmeta, and wp_options table which are still pointing to old domain.

These are the SQL syntaxs to update the tables:

UPDATE wp_posts SET post_content = REPLACE( post_content, '', '' );
UPDATE wp_postmeta SET meta_value = REPLACE( meta_value, '', '' );
UPDATE wp_options SET option_value = REPLACE( option_value, '', '' );
UPDATE wp_posts SET guid = REPLACE( guid, '', '' );

mysql replace

  1. erubinoff Reply
    • kumkum Reply

Leave a Reply

Your email address will not be published. Required fields are marked *