0

I have just transfered my wordpress site from a local host to my web host via FTP.

I can load up my home page using my domain but no CSS or JS are being loaded, looking at the console I can see it cant retrive the files as it is adding http://localhost/ in front of every file path.

Where can i go in to change all of these?

Sorry for the basic question i am quite new to wordpress.

  • Do a search in your files for http://localhost/ – David Lee Feb 25 '17 at 22:45
  • Is there a way to search every file at the same time for that phrase otherwise it will take hours to open every file – Adam Allen Feb 25 '17 at 22:47
  • have you updated your urls after website transfer? – Arsalan Mithani Feb 25 '17 at 22:58
  • No, do I have to do that in admin page? Sorry I have never migrated a Wordpress site before – Adam Allen Feb 25 '17 at 23:00
1

You must have to update your website URLs after migrating your site from live server to local or local to live server.

Go to your phpmyadmin and select your database, then in SQL section paste the following codes (replace http://www.oldurl.com to your localhost URL and http://www.newurl.com to your existing live domain URL, do it carefully) and click Go.

UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

It will replace your localhost URL with your new Live domain URL.

After that go to Settings > Permalinks then just click Update/Save button then check your website & its internal pages, make sure you quit your localhost so you can see if URLs are now updated & not.

Keep in mind

you may still have to change some URLs in your website content may be which you've put.

Method 2

There is also a plugin called Velvet Blues Update Urls, install & activate it then go to Tools > Update URLs then do the same put old url in old section and New live to New url section check all the boxes except Guid then click update, but its not guaranteed that all URLs will be updated.

I suggest run the above queries first, then you can also try this plugin as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.