Changing the Structure of WordPress URLs without Losing Traffic or Google Juice

colon-slash-slashI’m on my way out the door, headed to my daughter’s first trip to Coney Island and the Circus, so I won’t go into all the reasons behind why I’m changing the structure of my URLs, let’s suffice it to say that I’ve been thinking about it for quite a while and, after quite a bit of research, it seems like the right move to make.

What change am I making? I’m merely taking the date out of my URLs. The problem is that I don’t want to lose all my outside links and Google traffic by changing my permalink structure. I already showed you how to migrate a WordPress site to an entirely new domain and redirect your URLs, this is just another quick customization along the same lines.

Old URL structure: http://jamespoling.com/2009/01/moving-your-wordpress-blog-to-a-new-domain-without-losing-your-incoming-traffic/
New URL structure: http://jamespoling.com/moving-your-wordpress-blog-to-a-new-domain-without-losing-your-incoming-traffic/

Step 1: Go into Settings > Permalink Settings and set up your custom permalink structure. It should look like this:
wp_permalink_structure

Step 2: Either create or edit your .htaccess file on your server. (You’ll need an FTP client to access and upload this file).

    1. Inside your .htaccess file add this line of code
      RedirectMatch permanent ^/[0-9]{4}/[0-9]{2}/([a-z0-9\-/]+) http://jamespoling.com/$1
  1. Upload your .htaccess file to your root blog directory
  2. That’s it! Sit back and enjoy

Image courtesy of jeffsmallwood Flickr

How to: Specify your canonical to avoid duplicate content in WordPress

Yahoo, Microsoft and GoogleIn a rare show of collaboration Google, Microsoft and Yahoo made a joint announcement on Thursday that that they would support a new Web standard that will allow millions of Web publishers to remove duplicate pages from their Web sites.

“There is a lot of clutter on the Web and with this, publishers will be able to clean up a lot of junk,” said Matt Cutts, an engineer who heads Google’s spam fighting efforts. “I think it is going to gain traction pretty quickly.”

“We are happy that everyone is going to support the same implementation,” said Nathan Buggia, a lead program manager at Microsoft. “This is a clear benefit for publishers as it gives them an opportunity to get more exposure through search engines.”

Google Webmaster Central:

Carpe diem on any duplicate content worries: we now support a format that allows you to publicly specify your preferred version of a URL. If your site has identical or vastly similar content that’s accessible through multiple URLs, this format provides you with more control over the URL returned in search results. It also helps to make sure that properties such as link popularity are consolidated to your preferred version.

That’s great news for anyone out there looking for that extra bit of juice to drive some more traffic to your site and fortunately, if you’re using WordPress to publish your site, it’s pretty simple to add this functionality.
[Read more...]

Moving Your WordPress Blog to a New Domain Without Losing Your Incoming Traffic

u-haul-truck-pictureAs you may have read in the previous entry I recently came back into possession of jamespoling.com.  After selling off a blog network and taking a break from writing I recently started blogging again at jpoling.com. 

I was never 100% happy with that URL so, as soon as I was able to regain control of my domain, naturally the first thing I wanted to do was move everything over from jpoling.com to jamespoling.com.

The problem with that is, I already had some pretty good search engine traffic as well as links from other outside sources and I didn’t want to lose any of that traffic with the move.  All those incoming links and that tasty SEO I love so much, I really didn’t want to sacrifice any of it.  Fortunately, I did some research and realized, you don’t have to lose any of it.

How to migrate your WordPress site to a new domain without losing traffic

The first thing you’ll need to do is make sure you have your new blog set up at your new domain with your old content already imported in.  If for some reason you haven’t gotten that far or are stuck, feel free to contact me and we’ll get it worked out.

Once that is ready you’ll need to go into your WordPress settings on the new site and make sure you are using the same permalink structure that you were using on your old site.  e.g. If you were using Month and Name (/%year%/%monthnum%/%postname%/) on your old domain, make sure that’s what you have set on your new domain.  You can find those options in admin >> settings >> permalinks.

To run SQL queries, login to MySQL database that houses WordPress tables via phpMyAdmin or login to the DB server and run MySQL client as root.

  1. 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';
  2. 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');
  3. 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');

That’s it!  Your done.  When someone visits or clicks on a link to your old URL they will be automatically forwarded to your new URL.  If they click on an incoming link like http://jpoling.com/2009/01/google-reveals-hidden-features-in-iphone-app/ they will be automatically redirected to http://jamespoling.com/2009/01/google-reveals-hidden-features-in-iphone-app/.  Go head, try it out.  Type in jpoling.com in your browser and see where you end up.  Enjoy!