Home > OS >  First pagescan not display when I change domain name in wordpress
First pagescan not display when I change domain name in wordpress

Time:04-17

As for the title, I changed the domain nane of my site, but when I go back to WordPress, my first page can display on the browser, seems like only HTML not any css. I has checked my all domain and address setting, they are all same. Can anyone help me with how to solve this problem? Thinks. enter image description here above picture is when I open my home page.

CodePudding user response:

In the Wordpress DB there are many reference of the domain. You have to change them before the website come back to live.

Here some sample queries you have to do, but PLEASE BE CAREFUL, MAKE A BACKUP OF THE DATABASE BEFORE:

Check if these references exist on the DB with the SELECT:

SELECT * FROM wp_posts where post_content like '%<OLD DOMAIN>%';
SELECT * FROM wp_posts where guid like '%<OLD DOMAIN>%';
SELECT * from wp_options where option_value like '%<OLD DOMAIN>%';

and only then, you can do a replace of the domain with the UPDATE:

UPDATE wp_posts SET post_content = REPLACE(post_content, '<OLD DOMAIN>', '<NEW DOMAIN>');
UPDATE wp_posts SET guid = REPLACE(guid,  '<OLD DOMAIN>', '<NEW DOMAIN>');
UPDATE wp_options SET option_value = REPLACE(option_value,  '<OLD DOMAIN>', '<NEW DOMAIN>');
  • Related