Artikel-Schlagworte: „WordPress“

Wordpress Blog Domain ändern

Donnerstag, 23. April 2009

Oft steht man vor dem Problem, ein Wordpress Blog von einer Domain zur anderen umziehen zu müssen. Sei es, daß man sich für eine andere Domain entscheidet, oder man das zu Hause auf localhost entwickelte Blog online stellen will. Ursache für die Schwierigkeiten ist, daß Wordpress Links zu internen Artikeln nicht relativ, sondern absolut speichert. Es müssen also alle Links geändert werden. Nach verschieben aller Dateien und eventuellem Anpassen der Dateien wp-config.php und .htaccess, hilft folgendes Fundstück ungemein weiter:

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ’siteurl’;

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, ‘http://www.old-domain.com’,'http://www.new-domain.com’);

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’);

via How to Move WordPress Blog to New Domain or Location » My Digital Life.

WordPress Blog zu neuer Domain verschieben

Sonntag, 8. Februar 2009

Wenn man ein WordPress-Blog auf einem lokalen Webserver erstellt und/oder wartet, steht man immer wieder vor dem Problem, daß viele Konfigurationen und Links wegen der veränderten Domain nicht mehr funktionieren. Der Grund ist, daß WordPress leider absolute statt relativer URLs in der Datenbank speichert. Erfreulicherweise habe ich jetzt eine Lösung gefunden, wie man diese absoluten Links ändern kann:

To update WordPress options with the new blog location, use the following SQL command:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table as guid field. The URL values in this field are stored as absolute URLs instead of relative URLs, so it needs to be changed with the following SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

If you have linked internally within blog posts or pages with absolute URLs, these links will point to wrong locations after you move the blog location. Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Quelle: My Digital Life: How to Move WordPress Blog to New Domain.

Das gleiche gilt natürlich auch, wenn man mit einem WordPress-Blog zu einer neuen Domain umziehen möchte.