Move WordPress blog to new domain
Moving to a new domain with your WordPress blog can be just as annoying as moving to real life. We have a few tips for you so that your blog can be moved as smoothly as possible.
The export of WordPress data
At the very beginning of your domain change, you have to export and save your data. In wise foresight, the developers of WordPress have provided you with a tool for this.
- To export the data, first go to your dashboard.
- Then you will find the "Tools" on the left side and select "Export data". You can select which data should be exported, if you move the blog you will probably choose all of them.
- After you have made your selection, click on "Download export file" and then the data will be saved on your computer.
- In the file "wp-config.php" you will find your previous access data, such as "DB_Name", "DB_Password", "Db_Host" and "DB_User". You replace the data of your "old" domain with the new access data.
- To import the WordPress data to your new domain, follow the same route as described above, but in this case you choose the "Import data" option.
Your blog's database files
- You can export the database files to be backed up using MySQL, for example, and save them on your computer.
- Of course, you also have to update the entries in the database data according to the URL of your new domain. The two tables "wp_options" and "wp_posts" are decisive.
- Of course, you can also make the modifications manually. However, the phpMyAdmin program will make the task more convenient and, above all, significantly faster.
- In order to change the entries in the tables "wp_options" and "wp_posts", click on the SQL tab in phpMyAdmin and then enter the following two commands - whereby you will of course replace "myOldDomainAddress" and "myNewDomainAddress" with your corresponding URLs:
- For the changes in the table "wp_options": UPDATE wp_options SET option_value = replace (option_value, '//www.meineAlteDomainAdresse.de', '//www.meineNeueDomainAdresse.de') WHERE option_name = 'home' OR option_name = 'siteurl ';
- For the changes in the table "wp_posts": UPDATE wp_posts SET guid = replace (guid, '//www.meineAlteDomain.de', '//www.meineNeueDomain.de');
- After you've done that, import the database into your new domain.
Redirect search engines to your new domain
Finally, you use a "301 Redirect" to inform the search engines that you have moved your WordPress blog. In addition, you forward the visitors who came to the old domain via a search engine to your new WordPress domain.
- In the root directory of the server of the "old" domain, create an ".htaccess" file. Please do not forget the period before htaccess and then enter the following in the file:
- RewriteEngine on
- RewriteCond% {HTTP_HOST}! ^ Www \ .meineNeueDomain \ .de $
- RewriteRule ^ (. *) $ //Www.meineNeueDomain.de/$1 [L, R = 301]
If you want to know how many visitors find their way to your new domain, we will tell you how to easily insert a visitor counter in WordPress.