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:

  1. First the obvious - backup DB of site you want to move
  2. Copy the “wp-content/uploads” directory, make sure to set file permissions after the copy
  3. Copy the “wp-content/uploads plug-ins” directory
  4. Copy the theme
  5. 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';
  6. Update the posts table UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');
  7. Update wp_postmeta UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com','http://www.new-domain.com');
  8. Update upload path UPDATE `sheqafri_advantage`.`wp_options` SET `option_value` = '/your/new/path/wp-content/uploads' WHERE `wp_options`.`option_name` = 'upload_path';
  9. .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]
  10. 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
  11. 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();
Follow Me on Twitter