Creating a new web site in WordPress. Doing so, I create the web site at a subdomain such as: new.foowebsite.tld
After the web site is up to client standards, we change the dns at the name servers.
Now we have little squares where pictures once were. The pictures are coming from the CSS but only strange characters show.
Here's how to fix.
1- change in the sql database:
-go to myphpadmin
-use the following as a guide. Be sure to change "wp_" with the prefix of your database "fooprefix_".
UPDATE wp_options SET option_value = replace(option_value,'http://old.url.tld','https://www.newurl.tld') WHERE option_name ='home' OR option_name ='siteurl';
UPDATE wp_posts SET guid = replace(guid,'http://old.url.tld','https://www.newurl.tld');
UPDATE wp_posts SET post_content = replace(post_content,'http://old.url.tld','https://www.newurl.tld');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://old.url.tld','https://www.newurl.tld');
This can be used to go from http to https as well. Or to go to an entirely different domain name.
2- change in the file names:
But that doesn't change the files. If you are a sysadmin, you can use grep. Also WordPress has some built in functionality if you ssh into the server.
First, test:
wp search-replace 'http://old.url.tld' 'https://www.newurl.com' --dry-run
Then run:
wp search-replace 'http://old.url.tld' 'https://www.newurl.com'
3- check the wp-config.php
Sometimes the site is hardcoded into the wp-config.php file. Check it to make sure it is correct. The hard coded line will typically be the last lines.
NOTES:
-here is the long version: https://codex.wordpress.org/Moving_WordPress