Reputation: 19967
It seems like an issue that has been talked about a large number of times, but for some reason, I can't seem to get it to work.
Goal: Change Wordpress site from example.com/wordpress to example.com/blog
Here is what I've tried:
When that did not work, I also went into my theme's functions.php file and added:
update_option('siteurl','http://example.com/blog');
update_option('home','http://example.com/blog');
immediately after the opening
<?php
tag.
Is there something I am missing?
Upvotes: 0
Views: 861
Reputation: 696
When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://example.net - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:
1- Only perform a search and replace on the wp_posts table.
2- Use the Search and Replace for WordPress Databases Script to safely change all instances. ( If you are a developer, use this option. It is a one step process as opposed to the 15-step procedure below )
Info taken from http://codex.wordpress.org/Moving_WordPress
Search and Replace for WordPress Databases Script: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Upvotes: 2
Reputation: 2600
You could try this plugin: http://wordpress.org/plugins/wp-migrate-db/
From its own description: "Exports your database, does a find and replace on URLs and file paths, then allows you to save it to your computer."
Upvotes: 1
Reputation: 3949
You need to update all URLs in your database too.
Take a look at this script: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Upvotes: 1