WordPress.org

Ready to get started?Download WordPress

Forums

changing the siteurl messes up the WP blog (6 posts)

  1. tom704
    Member
    Posted 10 years ago #

    In the options where it says "siteurl is your blog's URL: for example,......" , if the url is changed the whole blog is messed up. I reset the blog to correct it in a re-install. Is there a way to correct something like this without losing everything in a re-install?

  2. OperaManiac
    Member
    Posted 10 years ago #

    how do u reset a blog? a simple way would be to reset the blog URI using phpmyadmin.

  3. MattRead
    Member
    Posted 10 years ago #

  4. tom704
    Member
    Posted 10 years ago #

    Matt, how do I use it?
    <?php
    // Fill in your WordPress URI below
    $uri = 'http://www.example.com/wordpress/';
    require('wp-config.php');
    $wpdb->query("UPDATE $wpdb->options SET option_value = '$uri' WHERE option_name = 'siteurl' OR option_name = 'home'");
    echo "Blog and WordPress address have been reset to $uri.";
    ?>

  5. tom704
    Member
    Posted 10 years ago #

    I ran it and it said Blog and WordPress address have been reset but it isn't changed.
    This is what it says
    SQL/DB Error:
    [You have an error in your SQL syntax near 'SET option_value = 'http://www.mysite.com/wpblog' WHERE option_name' at line 1]
    UPDATE SET option_value = 'http://www.mysite.com/wpblog' WHERE option_name = 'siteurl' OR option_name = 'home'
    Blog and WordPress address have been reset to http://www.mysite.com/wpblog.
    --------
    I tried with and without the trailing '/' , mysite.com is of course changed to my actual site url. lol What is the SQL/DB Error? Is that the problem?

  6. rueger
    Member
    Posted 9 years ago #

    I wound up logging in via phpadmin on my server (or my VWS on my ISP's server), and searching mySQL for "siteurl".
    That appears in the wp_options table.
    I edited the siteurl field, clicked "go", and everthing seems fine again.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.