The WordPress- and the Site-Adress are automatically adopted during the installation process of WordPress and may be changed in the administrator panel after the installation is completed. However, acting with caution is of outmost importance here, as entering a wrong URL may cause that WordPress is no longer accessible. This article explains the reasons for this behaviour and how the addresses can be restored.
Meanwhile, this issue represents a classical topic in the support forums on WordPress Deutschland. It is very luring to apply changes to the two address fields displayed in the admin panel. What is changed there, however, is by far not self-explanatory. The changes cannot be easily undone as the administrator panel is no longer accessible.
The shock is huge and the user gets the feeling that the site is crashed completely. But not the worst case occurred. WordPress is still there and if the addresses are set back, everything will again be accessible like usual.
The WordPress Address (URL) explained
The WordPress Address represents the URL of your site addressable with a browser. Your domain directs to the main directory of your webspace, which is usually setup by your internet provider. It doesn’t matter if you did the installation of WordPress manually or via the browser, WordPress adopts the WordPress Address automatically.
You have the main directory in which WordPress has been installed, your domain directs to this directory and this directory also includes the index.php of WordPress. If existent, the data file index.php is always read first within a directory (exceptions exist, however are not of relevance in our case).
In short, the WordPress Address represents the URL, directing to the index.php of your installation and therewith allows for reaching WordPress with the browser.
In case you change the WordPress Address you have a big chance that your site is no longer accessible. Usually, a 404 (Not Found) status will be displayed in the browser.
The Site Address (URL) explained
The Site Address represents the URL among which all files and folders of WordPress can be reached. Usually the Site Address and the WordPress Address are identical, but there is also a possibilty to store the files and folders of WordPress in a different directory.
In the main directory – directed via the WordPress Address – is the directory wordpress located, which includes all files and folders of WordPress. The index.php has to be copied in the main directory and customised in order to keep WordPress accessible. The Addresses would be as follows:
- Site Address (URL): http://example.com/wordpress/
- WordPress Addresse (URL): http://example.com/
This example is given for a better understanding, additional modifications would be necessary, which are not explained at this point.
Why should one change the Addresses at all?
Different settings for changing the Addresses exist, the most frequent ones are:
- WordPress was by accident installed in a sub-directory, but shall be accessible directly via the domain. For example directly via http://example.com and not via http://example.com/wordpress/.
- The domain shall be changed. For instance, instead of http://example.com http://example.org shall be used.
I can no longer access WordPress – what shall I do?
Don’t panic! The WordPress Address and Site Address are stored in the database in the table wp_options in the fields home (= WordPress-Adresse) and siteurl (= Site Address) and can be reset directly in the database or with an entry in the file wp-config.php. Both possibilites will lead to the same result: Your site will be completely accessible again.
Recovery of the Addresses via wp-config.php
Experienced users won`t hesitate to change the addresses directly in the database, but the WordPress developers also looked ahead for this issue.
During the installation the file wp-config.php is created, which has to be modified as follows:
- Download the file wp-config.php via FTP programm and open it using a code- or a text-editor.
- ahead of line
/* That's all, stop editing! Happy blogging. */ insert the following line:
12define('RELOCATE',true);/* That's all, stop editing! Happy blogging. */
Upload the changed file via FTP again.
- Call the URL to the file wp-login.php with your browser, e.g. http://example.com/wp-login.php and login as usual.
- Both addresses were reset in the database and you can remove the added line from the wp-config.php again.
Et voilà, your WordPress-Installation is again accessible!
I hope that this post could improve the basic understanding of the WordPress- and the Site-Address and their recovery options. For People who want to learn more about that topic I recommend the contributions “Giving WordPress Its Own Directory” and “Changing The Site URL” published in the WordPress Codex.
New Plugin: Slack Connector - Connect WordPress, WooCommerce and Slackby Michael Firnkes
Initially we merely wanted to optimize our own Slack-processes. With automated notifications from our MarkettPress shop, the blog and our forums. The resul ...Read more
Inpsyde is the first WordPress.com VIP partner in Germanyby Michael Firnkes
Automattic has given us the title of WordPress.com VIP Service Partner, the first in Germany, Austria and Switzerland. Worldwide, there are only eleven com ...Read more
Inpsyde is a WooExperts Gold Partner of WooCommerceby Michael Firnkes
A few weeks ago, Inpsyde GmbH with MarketPress became a certified WooExperts Gold Partner. This is confirmation from WooThemes of our agency’s know-h ...Read more
BackWPup Pro: Secure WordPress Backup with Google Driveby Michael Firnkes
The Pro version of our BackWPup plugin supports the backup of WordPress databases and files to Google Drive. But how do you set something like that up? And ...Read more