Migrating Wordpress Permalinks from postname to post_id/postname - wordpress

My blog's been up for a year or so, and 90% of our traffic comes from Google, so I want to make sure that I'm handling this permalink change properly. I recently read on Wordpress' codex that including the numerical %post_id% at the beginning of your permalinks can greatly reduce the stress on your database, when a post or page is being fetched. So, I decided to change my permalink structure from /%postname%/ to /%post_id%/postname/.
Now, if I type in, or click on a link to my site in google that looks like this - http://blog.com/cool-post/, it seems to redirect to my new structure: http://blog.com/34424/cool-post/ without a hitch. I'm trying to figure out whether I need to use a 301 redirect plugin or not. I would like to think that search engines like Google will see the same "flawless" redirection that I'm seeing. There doesn't seem to be any broken links. Just looking to confirm that I'll be okay after this change.
Thanks

WordPress handles canonical redirects for you by sending 301 Moved Permanently status codes appropriately. That status code ensures Google will only index your posts by the new URLs (i.e. with the post IDs in your permalinks). I've not used a redirection plugin for a while and my sites have been indexed similarly just fine.

Related

How can I redirect from a Permalink to a new permalink?

To add more detail, my current situation is that we are moving from Symfony2 to Wordpress (resources choice). Usually the redirect would require a relative link as source and a permalink as destination.
Let's call the domain http://example.com
Users with old links such as http://example.com/article/[id] need to be redirected to the new urls which is something like http://example.com/title
We have around 200 links that require redirecting and as you can see the new urls don't allow much for automating the process. My issue is if we set the .htaccess under the old installation and change the domain for it to example2.com, none of the users will ever stumble on it to be redirected.
Which leads me to ask if its possible to have a permalink on both ends of the redirect. I am open to any other suggestions to how to tackle the issue, except the old and new url formatting can't be changed in the current situation.
It might not be the most efficient way of doing it but, I get a list of all the links I need to redirect and a list of the new urls they are directing to and do a 301 redirect in the htaccess. This will change all indexes on google so they will show up without any issues.
Redirect 301 /article/1 /title

Redirect Ecwid URLs with fragment identifiers to new Woocommerce URL

I recently migrated a client's e-commerce site from Ecwid to WooCommerce. Ecwid's URL's use fragment identifiers which is now a problem as I can't set up a 301 redirect to the new URL using .htaccess. As I understand, everything past the # isn't accessible to .htaccess.
I'd like to try and preserve their SEO ranking as well as easily update all the old URLs to new.
There are dozens of Wordpress plugins which offer the ability to redirect pages, but I'm concerned I'll have the same issue. From what I've read Javascript redirects don't use the 301 response code, so search engines wouldn't know what the new URL is.
Is there any other way to redirect this:
example.com/products/#!/100-Cotton-Sash-Cord/p/19877065/category=4619310
to this?
example.com/shop/all-natural/100-cotton-sash-cord/
As you mentioned, everything after the # isn't processed by the server.
However, if your old site was previously indexed completely by Google, you can presumably pick the "ugly" URLs for the snapshot pages and redirect those?

Facebook forcing a redirect

For some reason, Facebook is picking up on a redirect on my posts which is leading to issues with sharing.
Take a look: https://developers.facebook.com/tools/debug/og/object/
Then try this URL in the debugger: http://punsdepot.com/pun/22
What's odd is if I change the permalink structure to use the post slug, it doesn't redirect.
I disabled all plugins to see if it was plugin related and found nothing. I also tried a couple of redirect detectors and everything seems to come back as a normal 200 response.
Any ideas?

Automated 301 redirect for any missing pages within specific directory

I am trying to help a friend move a Wordpress site to a new server. However, it has many old blog pages that he'd like to have deleted.
Instead of doing a 301 redirect for each and every blog that is about to be deleted back to the blog main page, is there a way to automatically create a 301 redirect for any of the missing pages of that directory only?
For example, any page that does not exist at www.website.com/blog/... would be automatically redirected to www.website.com/blog/ (not homepage)
However, for any other page such as www.website.com/otherdirectory/... would be treated as a regular 404 page.
Hope this makes sense.
We have Urban Giraffe's Redirection plugin installed for one off redirects already. Would be super if the other blogs to be deleted could be fully automated.
Thanks in advance.
Found my own answer (sort of) - hope this can help others:
Auto Redirect 404 in 301 for Trashed Posts
http://wordpress.org/plugins/auto-redirect-404/
There are a few caveats though. This plugin monitors what you are about to delete and then automatically creates a 301 redirect. Note that this does not help with already deleted posts.
Note that I have installed this, but I have now removed it after doing all of the deletions. Once I deleted all the unnecessary posts, it created a list of the 301's. I have copied this list then imported them into the Plugin below so that it can be managed by 1 plugin. Also, the issue I have with this plugin is that it also monitors media and pages. This means that if you delete a page (ie ...com/test/) it will make a redirect - however, if you create a page again later with the same URL (ie ...com/test/) that page will no longer be visible as the redirect has been created in a table of your database. This plugin does NOT let you undo a redirect. If you deactivate the plugin, the 301's will stop working so that is the only way to stop the redirects. All or nothing.
To manage other 301's and to turn on and off redirections for single pages, I use:
Wordpress Redirection:
http://wordpress.org/plugins/redirection/
This will allow you to add 301's for other urls. This also allows you to import a CSV. I have created a CSV with the list created with the above Plugin and imported into this for better management.
I have also turned off "monitoring" in the options section (Don't monitor) so that it will not accidentally create a bunch of unnecessary redirects. For example, if you create a blog post with this url: ...com/test/ and change it to ...com/test2/ it will automatically create a redirect. This means that later in the future, if you create a page ...com/test/ you will not be able to view it. It will always redirect to ...com/test2/. This kind of automation can be troubling if you forget this monitoring is on.
Hope this helps.
If anyone knows of a better way to automate any missing page from a particular directory, please let me know.

Wordpress: Two different Permalinks for same Blog

Is there any way we can have two different Permalinks in a Wordpress blog? This is because lot of us starts blogging when we have limited knowledge of SEO and end up in some URLs which are not that SE friendly.
Hence lot of pages from Blogs are already indexed by search engine and we do not want to spoil old URLs.
Thus I want to create new Permalink that is different than the old one. Only the newer post should use this permalink.
Is there any solution to this problem? Without 302 redirect we want to create 2 different Permalinks in the same Wordpress blog.
If I understand you correctly, you want to access the old posts only with the old permalink structure (e.g. ?p=123), and the new posts only with the new structure(e.g. /2009/08/name-of-article).
I'm afraid this is not possible without rewriting the Wordpress code (see short explanation at the end of my answer).
However, I think that Scott Yang's permalink redirect plugin (scroll down to FAQ) or Dean Lee's permalink migration plugin could be a solution.
Edit: both sites no longer exist. There are snapshots on Archive.com:
Scott Yang’s plugin, Dan Lee’s plugin.
These plugins are over 10 years old, however. The WP Redirect Permalink plugin might provide a similar service.
When Wordpress generates a link (e.g. for a new article, for "continue reading" links or for search results), it will use the new permalink structure, even for the old posts (which sadly isn't exachtly what you intended). If someone however uses an old permalink, it will be rewritten on the fly and the user (or SE) will be redirected to the correct page.
This 301 redirect should keep your page rank.
Explanation why having different permalink structures for old and new posts in parallel would mean changing Wordpress code:
For each post, Wordpress stores an unique ID (e.g. "123") and not necessarily unique post name (e.g. "name-of-article") in the database.
When an URL with a permalink like /2009/08/name-of-article is accessed, Wordpress translates this according to the currently configured permalink structure. If it constructs a link, it also does this according to the currently configured permalink rule.
You would need to add code toe Wordpress so that it uses two different rules depening on the age of the article.

Resources