I migrated a WordPress website on my sub directory and change both site_url from wp_options table.Flush the permalink as well but still links are broken. It seems that site_url() is not working. CSS, javascript and images are not working

Please help me to short out this issue.

3 Answers 3


This question was asked and answered in past!

Anyway it's a broken link problem, after moving a site to another domain or sub domain we face broken link problem.

To Fix Broken Links After Moving Your WordPress Site

  1. Log in to your WordPress admin panel.

  2. From the Plugins menu, click Add New.

  3. Type Search and replace, and then click Search Plugins.

  4. Locate the Search and Replace plugin, and then click Install Now.

  5. Click OK.

  6. Click Activate Plugin.

  7. From the Tools menu, click Search and Replace.

  8. Enter your old site's URL in the Search for field. For example, http://olddomainexample.com (no trailing slash).

  9. Enter your new site's URL in the Replaced with field. For example, http://newdomainexample.com (no trailing slash).

  10. Select All, and then click Go.

That's it.


By migrating site it will affect to the all path where you have declared like images, css, js and other urls. Because you have to update all the tables data.

So to make it workable use this plugin

It will solve your problem.


Just use searchand replace file given here: https://github.com/jmandala/searchreplacedb2

 (1) Put this 'searchandreplace.php' file in you wordpress root 
 (2) Then run this www.youdomain.com/searchreplacedb2.php 
 (3) Then add database details in fist step .In second step select all tables and continue and in third step put your old path to 'Search for (case sensitive string):' and in 'Replace with:' add new path and run it will change all paths on database.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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