Ausweb Web Hosting and Web Development Tutorials

banner-tutorials
You are here

Changing a WordPress Site URL

WordPress stores two addresses inside the database. These determine where your blog files are, and where the main index is. On a normal install, these addresses are the same. There are two occasions where you will need to access the database to alter one or both of these settings:
  1. If you have tried to alter the Blog URL or WordPress URL in Options and an error has occurred.
  2. If you have moved to a domain/subdomain with a different name.
BACKUP your database before you begin and store the backup off your site server, like on your hard drive. Quick fix methodIf you have access to the site via FTP, then this method will help you quickly get a site back up and running, if you changed those values incorrectly.
    1. Connect to your site via FTP;
    2. Navigate to the current active theme's folder and get a copy of the functions.php file. You're going to edit it in a simple text editor (like notepad) and upload it back to the site.
      The normal file directory for this is "wp-content > themes > themname > functions.php"
    3. Add these two lines to the file, immediately after the initial "
    4. update_option('siteurl','http://example.com/blog');
    5. update_option('home','http://example.com/blog')
      Use your own URL instead of example.com, obviously.
    6. Upload the file back to your site, in the same location. FileZilla offers a handy "edit file" function to do all of the above rapidly, if you can use that, do so.
    7. Load the login or admin page a couple of times. The site should come back up.
    8. Repeat the above steps, but remove those lines. IMPORTANT: DO NOT leave those lines in there. Remove them immediately after the site is up and running again
If there is no functions.php file in the theme: Create a new text file called "functions.php". Edit it with notepad, and add this text to it, using your own URL instead of example.com:

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

Upload that to your theme directory, then proceed as stated above. Remove the file afterwards. For more details and a few other methods, please follow the link below to the official WordPress support site. WordPress Support

WordPress is the perfect Content Management System for all your blog publishing and website management needs with one of AUSWEB's cPanel Hosting plans.
Articles In This Category
More from this Category
Tutorials > Wordpress Tutorials
All of AUSWEB's cPanel Hosting accounts come with Fantastico Deluxe, an automated installer for numerous web scripts and applications. Using Fantastic...
Tutorials > Wordpress Tutorials
WordPress is a powerful Content Management System (CMS) which functions as an easy to use personal publishing platform (or "blog"), and it comes with...
Tutorials > Wordpress Tutorials
Wordpress is a powerfull blogging application that is both easy to use, for the novice, and also has many features for the experienced blogger or deve...
Tutorials > Wordpress Tutorials
“Blog” is an abbreviated version of “weblog”, which is a term used to describe web sites that maintain an ongoing chronicle of information. A...
Tutorials > Wordpress Tutorials
By default WordPress uses web URLs which have question marks and lots of numbers in them, which is not good for S.E.O. (Search Engine Optimization). F...
Related Articles
Related Articles
cPanel-WHM > cPanel Sever Management
To change the SSH port number login as root, and edit /etc/ssh/sshd_config Find the line that says Port 22 and change 22 to any number between 1024-&...
Tutorials > Client Area Tutorials
Your Client Area is your primary destination for managing all of your personal account information, and of course your Ausweb products and services....
Tutorials > Wordpress Tutorials
For recent versions of WordPress, upgrading has been as simple as logging into your Dashboard, seeing the notification of a new version available and...
Tutorials > Wordpress Tutorials
The iPhone App-Store is home to thousands upon thousands of apps, some of them useful, some of them .. not so useful. One of the most popular and usef...
Tutorials > Wordpress Tutorials
The following tutorial will guide you through customising your WordPress website for viewing on the iPhone and other mobile smartphone devices using t...
Latest Articles
Latest Articles
Tutorials > Email Tutorial : FAQ for Email setup
This guide will help you configure your AUSWEB hosted email address with Outlook 2010....
Tutorials > Email Tutorial : FAQ for Email setup
This guide will help you setup and configure your AUSWEB hosted email address with Windows Live Mail (Outlook 2011)....
Tutorials > Partner (Affiliate) Guide
1. Visit http://partner.ausweb.com.au and click “Join Now” from the top navigation bar (or click the shiny green “Sign Up Now” button....
Tutorials > Website Security/Upgrade Issues
After installing an SSL, a commmon subsequent issue (in most modern browsers) is the the dreaded "Connection Partially Encrypted" warning.   The er...
Tutorials > Customer Testimonials
Now that you know about us, from us - this page is dedicated to what our customers think...
Most Read Articles
Most Read Articles
Tutorials > Joomla FAQ
A vulnerable extension is one that has been found to contain, or contribute to, a security vulnerability. Vulnerable extensions are not necessarily p...
Tutorials > phpBB Forum Hosting
Finally, after a long wait, phpBB3 has been released, and its relatively easy to upgrade your existing phpBB installation. phpBB3 introduces hundreds...
Tutorials > phpBB Forum Hosting
This video tutorial will show you how to create a new topic in phpBB3....
Tutorials > phpBB Forum Hosting
This video tutorial will show you how to set up a poll when starting a new topic in phpBB3...
Tutorials > phpBB Forum Hosting
phpBB3 is the latest update to the phpBB series, incorporating a plethora of new features, speed, stability and security improvements, and is much eas...