wordpress url change mysql code

I changed the url of my blog again recently here is some helpful mysql code to renaming a wordpress blog url. YMMV. You’ll need to find all the other fields which containd the old information. I’d like this to be a plugin, it’s more or less a set of simple database commands, but for now cut and paste code will work ok.

 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_comments` SET `comment_author_url` = REPLACE(`comment_author_url`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81','http://blog.px.ns1.net:81');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,':81//',':81/');
UPDATE `wp_xspf_player` SET `url` = REPLACE(`url`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'https://px.ns1.net/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://px.ns1.net:81/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[php]","<pre lang=\"php\">");
 
 UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[/php]","</pre>");

update:

UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'ns1.net/wordpress/','ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'/wordpress/wordpress/','/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81//','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'/wordpress','/');
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,':81','');

[tags]mysql, wordpress, wordpress database, mysql code, code, examples, URL, change, tables, fields, rename, replace, blog, mysql code,cut and paste, database commands [/tags]

Related posts:

  1. ugh, wordpress broke. OK, well something broke after my Twas the Night Before...
  2. quick fixes for my mysql databases. It’s the summer, and durring the summer heat servers tend...
  3. hilter in wordpress took the plugin from here updated to latest GeSHi went...
  4. wordpress issues, continued. so i took a backup file, and edited all the...
  5. wordpress! well mysql seems to be happier now that i’ve recompiled...

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

Bad Behavior has blocked 1199 access attempts in the last 7 days.