Getting rid of funny characters
Funny Latin characters got pasted into some of the posts, no this wasn't an straight forward UTF-8 / Latin encoding issue.
This is how I got rid of them.
update wp_posts
set post_content = replace(post_content,'’','\'') ;
update wp_posts
set post_content= replace(post_content,'…','...') ;
update wp_posts
set post_content= replace(post_content,'–','-') ;
update wp_posts
set post_content= replace(post_content,'“','"') ;
update wp_posts
set post_content= replace(post_content,'â€','"') ;
update wp_posts
set post_content= replace(post_content,'‘','\'') ;
update wp_posts
set post_content= replace(post_content,'•','-') ;
update wp_posts
set post_content= replace(post_content,'‡','c') ;
update wp_posts
set post_content= replace(post_content,'Â','') ;
10 things to remember when moving a Wordpress website
I normally set-up a website in a development environment when designing sites for clients. Once approved the site must be moved to the live domain.
Checklist:
- First the obvious - backup DB of site you want to move
- Copy the “wp-content/uploads” directory, make sure to set file permissions after the copy
- Copy the “wp-content/uploads plug-ins” directory
- Copy the theme
- Update the options table 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';
- Update the posts table UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
- Update wp_postmeta UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com','http://www.new-domain.com');
- Update upload path UPDATE `sheqafri_advantage`.`wp_options` SET `option_value` = '/your/new/path/wp-content/uploads' WHERE `wp_options`.`option_name` = 'upload_path';
- .htaccess updates only when using from a live domain to keep old incoming links valid RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(www\.)?old-domain\.com RewriteRule (.*) http://www.new-domain.com/$1 [R=301,L]
- Setting / privacy Make sure you check the “I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers”, I disable this on the development site
- Update wp-config.php with the new DB info
Plug-in specific:
NextGEN Gallery:
- copy the /wp-content/gallery directory
- Update the wp_options table UPDATE wp_options SET option_value = replace(option_value, 'old_open_basedir/wp-content/uploads, 'new_open_basedir/wp-content/uploads') WHERE option_name = 'upload_path'; note: get the new_open_basedir by running phpinfo();
