When we update database content link without using plugin then many problem generated if we update query without taking backup. In MySQL database we have to use following SQL query for different table.

UPDATE wp_options SET option_value = replace(option_value, 'https://mycodingsolution.com', 'https://mycodingsolution.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://mycodingsolution.com','https://mycodingsolution.com');
UPDATE wp_posts SET guid = replace(guid, 'https://mycodingsolution.com','https://mycodingsolution.com');

UPDATE wp_posts SET post_content = replace(post_content, 'https://mycodingsolution.com','https://mycodingsolution.com');

UPDATE wp_posts SET pinged = REPLACE(pinged, 'https://mycodingsolution.com', 'https://mycodingsolution.com')WHERE pinged LIKE '%https://mycodingsolution.com%';

if WordPress page has been made by WP page-bakery or editor then following query must be run


UPDATE wp_posts SET post_content = REPLACE(post_content, 'src="https://mycodingsolution.com', 'src="https://mycodingsolution.com')WHERE post_content LIKE '%src="https://mycodingsolution.com%';

UPDATE wp_posts SET post_content = REPLACE(post_content, "src='https://mycodingsolution.com", "src='https://mycodingsolution.com")WHERE post_content LIKE "%src='https://mycodingsolution.com%";

UPDATE wp_posts SET post_content = REPLACE(post_content, 'href="https://mycodingsolution.com', 'href="https://mycodingsolution.com')WHERE post_content LIKE '%href="https://mycodingsolution.com%';

UPDATE wp_posts SET post_content = REPLACE(post_content, "href='https://mycodingsolution.com", "href='https://mycodingsolution.com")WHERE post_content LIKE "%href='https://mycodingsolution.com%";

0 Comments

Leave a Reply

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