menus - Homepage is not loading

admin2025-06-02  2

I have developed my wordpress site locally and now it's live on a host. Everything is working fine, but when I click the Home button on the top menu it goes to localhost/wordpress, not to my exact homepage.. Help me fix this.

I have developed my wordpress site locally and now it's live on a host. Everything is working fine, but when I click the Home button on the top menu it goes to localhost/wordpress, not to my exact homepage.. Help me fix this.

Share Improve this question edited Feb 27, 2019 at 17:22 Nathan Johnson 6,5386 gold badges30 silver badges49 bronze badges asked Feb 27, 2019 at 17:13 Chanuka GayanthaChanuka Gayantha 32 bronze badges 3
  • you need to edit your database for references to the old (localhost) site and change them to the live url – rudtek Commented Feb 27, 2019 at 17:21
  • Could you please explain me how to do it.. which data i should change – Chanuka Gayantha Commented Feb 27, 2019 at 17:22
  • Added how I do it as an answer. – rudtek Commented Feb 27, 2019 at 18:42
Add a comment  | 

2 Answers 2

Reset to default 0

You need to go into your new database and change the site url and home url to the new address. I suggest NOT doing this through phpmyadmin or the WP dashboard (using plugins) though as it will cause some problems. Plugins May work, but if wordpress hangs or times out or any number of things you could have a bigger problem.

I recommend is using Search & Replace DB, a free tool by Interconnect, to replace any instances of the host name in the database. It will handle setting the serialized data correctly for you. and it works OUTSIDE of the WordPress system.

First make sure that your wp-config is for the right database.

Go get this tool: https://interconnectit/products/search-and-replace-for-wordpress-databases/

Upload it into your www/ folder. (I usually rename the search and replace folder to SRDB.)

Now navigate to your site with the SRDB at the end on the NEW url. (www.example/SRDB) and the top two lines you'll see a search field and a replace field. (if you get a db connection error here, double check the wp-config to ensure that it has the right credentials).

In the search field, place your old site address.

In the replace field, place your new url.

Hit live run.

ONLY do this after ensuring you're on your new url and that SRDB has loaded into your new database.

Remove the SRDB folder when you are done.

probably is a database migration problem: inside your database table wp_options there are two options, home and siteurl, which in your case must have set as value the "real" homepage in your website.

To complete the migration you should run a search and replace on the whole database, after fixing the options table, to find every url using the old localhost address. Use this plugin to do it.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748858142a314305.html

最新回复(0)