Forums

Accidently changed site or home url? don't panic! (7 posts)

  1. webleo
    Member
    Posted 1 year ago #

    For some unclear reason, WordPress allows you to change the site's url, which after being done renders the site inaccessible and unloginable.

    That's what happened to me. I changed those values in the general settings page, and afterward the site redirected to the "new" url, and whenever I logged in, the login page took me back to login again, with no message or clue to what happened.

    Sure, I could change the siteurl field in wp-options table in the database, but I had no access to it, no phpmyadmin at my disposal, and not to mention any decent database directory permissions...

    Well, after hours of trying to reupload the backup database I prepared before starting to work (it didn't help, permissions again), defining siteurl in wp-config.phpand other tips I got on other help pages, I finally found something that worked:

    Adding the lines:

    update_option('siteurl','http://example.com/blog');
    update_option('home','http://example.com/blog');

    to the beginning of functions.php did the job for me. I got it on http://codex.wordpress.org/Changing_The_Site_URL, though many other tricks from that page didn't help.

    I wasted so much precious time on this silly "feature" of the WordPress back-end, so I decided to share. Hope it will help someone.

    Webleo

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  3. ClaytonJames
    Member
    Posted 1 year ago #

    Silly features.... I do so very much hate those things!!!

    :-)

    For some unclear reason, WordPress allows you to change the site's url, which after being done renders the site inaccessible and unloginable.

    The new URL simply needs to point to a valid wordpress installation path. Happens to everyone at least once!

  4. webleo
    Member
    Posted 1 year ago #

    ClaytonJames - :D
    Yeah it's probably beginners' un-luck.

  5. thisisedie
    Member
    Posted 1 year ago #

    For some unclear reason, WordPress allows you to change the site's url

    For some unclear reason, people like to blame software when they screw something up.

    which after being done renders the site inaccessible and unloginable

    Not if you do it correctly.

    The feature exists so people can direct their site where they want it to be. Using the download from the link above or using your hosts auto installer generally assumes you know a little bit (at least) about the process. If you don't, you should learn instead of blaming the software. I'd be highly disappointed if the option weren't available.

  6. webleo
    Member
    Posted 1 year ago #

    thisisedie - Sorry, you are right.
    But it is very easy not to notice and shut your site this way. I just wish there was some sort of a warning or an easy way to undo it.

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    There is an easy way to undo it. The page I linked to above provides a number of different solutions.

Topic Closed

This topic has been closed to new replies.

About this Topic