WordPress Canonical URL
This plugin is pretty simple. It is designed to redirect any non-standard single-post URIs to the appropriate permalink.
For example, if you were to go to http://isaacschlueter.com/index.php?p=255&page=2, then you’d see a picture of my fiancée and me by some tulips on the Upper West Side. However, you’d also see an ugly URI in your address bar.
With this plugin, you’d be redirected to /2005/06/breanna/2/ instead.
Here’s what to do if you want this:
- Get cannonical-url.php.
- Upload it to your
/wp-content/plugins/directory. - Activate it in your Plugins page in the backoffice.
Enjoy
New Version: 0.3
Version 0.3 is much improved over the earlier release.
- Redirection happens on the
page_templateandsingle_templatefilters instead ofpage_redirectaction, so more information is readily available. - Uses the
$wp_queryobject directly instead of relying onthe_post(), which can cause screwey things to happen sometimes. - Better checking for where we are when it’s running, so there’s zero chance of affecting feeds, 404, etc.
- Less code!
- A helpful
301message in the response body. - Works on Pages, too!
- Unfortunately,
cannonicalcanonical is still spelled wrong.
My bad. I just realized that today, and it would be way too much effort to go through and correct all the postings in various places, set up a redirection to the new URI, etc. On the plus side, I show up first if you search google for “cannonical”.
This is especially nice if you add “shortcut URIs” to your .htaccess file. Here’s what I use:
RewriteRule ^p(ost)?(id)?/?([0-9]+) index.php?p=$3 [QSA,L]
RewriteRule ^id/?([0-9]+) index.php?p=$1 [QSA,L]
RewriteRule ^t(itle)?/(.*) index.php?name=$2 [QSA,L]
That allows me to type /p305 or /title/sidebar-expando/ and have the link redirect to the proper page. This is handy if you know the post-slug or the ID, and want to quickly type it onto a messageboard or something.
On July 14th, 2006 at 20:26:53, Elena’s Blog » Using a static home page Said:
[…] I achieved this by means of the Filosofo Home-Page Control plugin. However, for it to work I had to deactivate another plugin, WordPress Cannonical URL, because using both of them together exceeded the limit of address re-writes. […]
On September 12th, 2006 at 05:59:14, Stephane Said:
Hi,
Is this working with IIS 6 on win 2003 and WP 2? I tried, but it keeps saying « No input file specified ».
Thanks for any help,
Stephane
On October 5th, 2006 at 14:17:05, TEKNOIRE Said:
[…] WordPress Canonical URL : Fait en sorte que vos billets soient tous accédés avec la bonne URL, sinon effectue une redirection 301 […]
On January 6th, 2007 at 06:21:43, SEO for feinschmeckere: 301-redirect URL-plugins til WordPress Said:
[…] Pluginet Permanent Redirect sÃ¥ godt ud, men desværre fik det min side til at gÃ¥ ned (troede det var servere, men det var i virkeligheden pluginnet). Derfor installerede jeg WordPress Canonical Plugin og det fungerer fint. du kan prøve ved at gÃ¥ ind pÃ¥ ordpress.dk/?p=3 […]
On April 13th, 2007 at 16:10:19, Wordpress et moi - liste des plugins utilisés sous Wordpress » Free-Culture.fr Said:
[…] WordPress Cannonical URL […]
On April 18th, 2007 at 10:48:27, Project Blogger: Beachamptons Blog Makes a Splash Said:
[…] Wordpress Cannonical Url - Redirects requests for a single post to the proper permalink location. […]
On April 27th, 2007 at 07:44:36, » How to avoid duplicate content in search engine promotion Said:
[…] are Wordpress plug-ins that may help you do this, he […]
On May 4th, 2007 at 04:33:30, einfach persoenlich Weblog Said:
Canonical URL – ein Google & Domain-Problem vom Tisch…
Canonical URL - etwas Hintergrund zu Googles Update Aktivitäten bringen Informationen und Hintergründe zu diesem Begriff. Mit ein paar Handgriffen sind mögliche Probleme zugleich suchmaschinenfreundlich vom Tisch. Wer sich etwas auf die …
On May 18th, 2007 at 11:20:17, Blog Web-Création.ca » Blog Archive » Comment référencer son blog ? Said:
[…] WordPress Canonical URL : Fait en sorte que vos billets soient tous accédés avec la bonne URL, sinon effectue une redirection 301 […]
On May 20th, 2007 at 00:47:48, WP Plugins DB » Blog Archive » WordPress Cannonical URL Said:
[…] Visit […]
On September 17th, 2007 at 13:32:15, SEO 101 | Duplicate Content avoidance tips Said:
[…] WordPress Canonical URL Plugin. If you are using WordPress (as I do), install this plugin to take care of duplicate pages that can […]
On January 20th, 2008 at 02:58:25, WP-SuperBlog.com » Blog Archive » Schlueterica » WordPress Canonical URL Said:
[…] Rotating Banners, Header Art, Images, Quotes, and Content on Your Blog « Lorelle on WordPress: [ ] Lazarus Long Quotations WordPress Plugin [ ] jrdeahl: Running W2k sp4,apache 2 More Blog Resources […]
On March 23rd, 2008 at 04:23:19, A simpletons dynamic php site - Graphic Design Forum and Web Design Forum Said:
[…] different ways to do it » Alternative Rewrite Rules boren.nu Using Permalinks « WordPress Codex Schlueterica » WordPress Canonical URL Also have a look at some of these essential wordpress plugins My Top 20+ Wordpress Plugins ‹ […]