HowTo – WordPress My imported Content has URLs Pointing to my Old Site

Filed under: Wordpress Tips

Question

I was on blogger and had a redirect to take out the blogspot.com, I have switched to WP but now have a different site name.

I’ve imported all my posts, but of course now any URLs that were going to blogger are broken.

Which means all links on other sites (within my posts) and Pinterest pins get a 404 error.
How would I go about fixing these?

Answer

Redirecting each post is probably very difficult
since you are starting off on WP you should find a good permalink structure that will work for you in the future.

Although some people think it is ugly I prefer to use.
It is recommended to always include the ID in your Permalink structure.

PostID/PostName.html

If you use dates it can throw off your SEO and it can cause different problems later unless you also include the postid.

This is because your post can always be found with the PostID…
So if your url is yoursite.com/postid/postname.html
your post can be found with yoursite.com/postid and it will resolve

so back to your problem

Where are these links? are they hard coded in your post?
if they are in your posts what you can do is a search and replace using a plugin or using phpMyAdmin

First backup your database

install one of the find replace plugins

http://wordpress.org/plugins/find-replace/

find the string you need to change across your site and change it.

you could also redirect
.htaccess settings can redirect old urls to new ones.. not a pleasant way to do this though and its a hack not a fix

or with a plugin
http://wordpress.org/plugins/safe-redirect-manager/