Wordpress Has Accidentally Changed My Blog Path

Self-hosted WordPress blogs are dependent on having the correct URL information in the database -- without the correct URL, you'll have no way to log in and fix the error. WordPress offers several potential solutions for fixing your blog URL when you can't log in, with varying levels of difficulty. Before you can fix the error, you'll need access to either the WordPress files on your server via FTP or to the database that stores your blog information.

  1. Significance of the Blog Path

    • There are two parts of your blog URL, which you can find by clicking "Settings" then "General" in the left-hand column of your WordPress dashboard. The first is the WordPress address (URL), which defines where on your Web server your WordPress files are installed. The second is the Site address (URL), which defines the URL of your blog. If your WordPress files and blog are located in the same place, these two will be the same. If you have your WordPress files installed somewhere else and your blog at a different place -- such as "www.yourdomain.com/wordpress" and "blog.yourdomain.com" -- then these will be different.

    The Relocate Method

    • What might be the quickest method for modifying your blog's URL is what the WordPress Codex calls the Relocate Method. This method changes the Site URL to whatever domain you're accessing the files from -- giving you access to your administration files so you can change your URL back. You'll need to modify the wp-config.php file, located in the base directory of your WordPress installation. Using your FTP program of choice, make a backup copy of your current wp-config.php file. Open the current file in your preferred plain text editor. Below the MySQL settings, you'll see four "define" statements. Add a line below the the last one and paste:

      define('RELOCATE',true);

      Save the updated wp-config.php file to your Web server, and go to your WordPress login page (yourdomain.com/wp-login.php). Log in and go to "Settings" then "General" and fix the URLs. Afterward, go back to your wp-config.php file and remove the relocate statement.

    Setting the URL Manually

    • Another simple method of changing your blog URL is to set the Site URL and home path directly in the wp-config.php file. This has the advantage of being a quick fix, but it removes the ability to manage the URLs from the WordPress Settings menu at a later date. To do this, open the wp-config.php file on your Web server. At the end of the document, add the following two lines:

      define('WP_HOME','http://yourblog.com');
      define('WP_SITEURL','http://yourblog.com');

    Changing the Database

    • If you're more comfortable dealing with the MySQL database for your WordPress blog, or do not have access to the WordPress files on your Web server, you can correct your blog URL by accessing the WordPress database using phpMyAdmin via your Web host's control panel. When there, find and open the "wp_options" table. Click the browse button and look for the "siteurl" field under "option_name." Edit this field with your correct blog URL and save the settings. Go back to the "wp_options" table and find the "home" field. Change that as well. Save your changes.

Related Searches:

References

Comments

Related Ads

Featured