skip to Main Content

I have migrated the site and all the images are in the expected folders (these are discoverable). I need to change the links from to newsite.com/ but whatever I do they’re still pointing to old-site.com/.

Using WordPress, Beaver Builder.

Things I have tried:

Ran the following query on my database:

UPDATE wp_posts SET post_content=(REPLACE (post_content, 'old-site.com','newsite.com'));

and

UPDATE wp_posts SET guid=(REPLACE (guid, 'old-site.com','newsite.com'));

and the following, which resulted in an error because there’s no such column as meta_value

UPDATE wp_options SET option_value = replace(meta_value,'https://old-site.com/','https://newsite.com/');

Used Beaver Builder to re-save images individually. They appear correctly with the new url, until the page is refreshed.

Re-saved Permalinks.

Purged the SG Cache.

Cleared cache at Settings > Beaver Builder > Tools

Hard refresh. Cleared browser cache. Incognito browser.

Added the following to wp-config.php:

define('WP_HOME','https://newsite.com/');
define('WP_SITEURL','https://newsite.com/');

There are no posts in the database still pointing to the old url. The images are not referenced in the theme files or styles.

I have hundreds of images so any help would be greatly appreciated, thanks!

3

Answers


  1. Chosen as BEST ANSWER

    I used the Better Search Replace WP Plugin to search for old-site.com and replace with newsite.com. I also removed Transients using the Transients Manager plugin http://wordpress.org/plugins/transients-manager/.

    Check the database for any remaining references to old-site.com using the following queries on the database (thanks @lwin-ko-ko):

    SELECT * FROM wp_postmeta WHERE meta_value LIKE "%old-site.com%"
    SELECT * FROM wp_posts WHERE post_content LIKE "%old-site.com%"
    SELECT * FROM wp_posts WHERE guid LIKE "%old-site.com%"
    SELECT * FROM wp_options WHERE option_value LIKE "%old-site.com%"
    

  2. I have had the same problem, finally I was able to solve it by doing a complete migration with the plugin "WP Migrator", since then all my links are detected and I don’t use any other method anymore.

    I hope it works for you.

    Login or Signup to reply.
  3. I think first thing you need to identify the images including page is coming from cache or from user server(same-origin). Check with Chrome Developer tools.

    Inspect > Network > Check you page url > check header response > server

    enter image description here

    If from cache-server like ‘cloudflare’ or cf-cache-status: HIT status found you need to clear the cache. It will different depending on your hosting provider or which cache you used.

    If not, check on the MySQL DB again with such follwing query in each table –

    SELECT * FROM wp_postmeta WHERE meta_value LIKE "%old-site.com%"
    SELECT * FROM wp_posts WHERE post_content LIKE "%old-site.com%"
    SELECT * FROM wp_posts WHERE guid LIKE "%old-site.com%"
    SELECT * FROM wp_options WHERE option_value LIKE "%old-site.com%"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search