Posted By

108Bits on 09/03/14


url database wordpress update site home

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Admin Fix for WordPress

 / Published in: PHP

Add the code below to change the Home & Site URL that is configured in the database (wp-options table) by WordPress. Whenever you copy/move a site to a new hosting and the URL has changed you can use the code below to fix any strange redirects that might happen.

  • Insert code to wp-loging.php
  • Add your new url.
  • Surf to (site & home url is now updated)
  • Remove code from wp-login.php again
  1. // Update the Site & Home URL in the database (wp-options table)
  2. // Remove after the database has been updated
  3. update_option('siteurl', '' );
  4. update_option('home', '' );

Report this snippet  

You need to login to post a comment.