Search Permalink

Search Permalink redirects search form queries to cruft-free permalink URIs.

For example, the search term “foo” was entered on the search <form>. A browser would usually GET the page using this URI:

http://example.com/?s=foo

Search Permalink would redirect this query to a better-looking address clearly indicating that a search was made, like this:

http://example.com/search/foo/

Download Plugin

Change Log

Version 1.1
Released 17 October 2007

Changes:

  • Added client-side script to lessen server-side processing and redirects.
Version 1.0.1
Released 14 October 2007

Changes:

  • Support for any combination of permalink and query string requests for search term and page number.
Version 1.0
Released 25 August 2007

Changes:

  • Fixed URL encoding bug.
Version Beta 1
Released 19 August 2007

Changes:

  • First beta release of the Search Permalink plugin.

License

Copyright © 2007 Aja Lorenzo Lapus

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Read the full license

Comments

68 responses to “Search Permalink”

  1. Titanas Avatar

    Great job. Would it be possible to provide examples of the ugly and friendly URLs?

  2. […] findes imidlertid et plugin som løser dette. Plugin’et hedder Search Permalink. Pluginet ændre søge-URL’en til “domæne.tld/search/søgestreng/”. Jeg har […]

  3. Aja Avatar

    Well, yes of course. Maybe visitors would understand what the plugin does easier that way. Thank you. 🙂

  4. Jerry Avatar

    Using this on my site now, thank you!

  5. Titanas Avatar

    Great job! Your plugin is awesome and does redirect even old ugly post links “/?s=foo” to the new beautiful permalinks “/search/foo” when clicked on them. This is something that Alex’s solution doesn’t offer.

  6. Jared Schwager Avatar

    Great plugin! I’ve been looking for a plugin or hack to do this for a while.

  7. UFCDrill.com Avatar

    I get this:

    Not Found
    The requested URL /search/chuck/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  8. Jared Schwager Avatar

    Still love using your plugin, but I use the “WP Plugins Tracker” from wp-plugins-db.org and your plugin doesn’t seem to be in their database, so I have no idea what the latest version of your plugin is.

    Could you perhaps add your plugin to the database? I love using their plugin version tracker as it saves me so much time. Thanks for the great plugin!

  9. […] Search Permalink Omdanner søgningernes adresser til søgemaskinevenlige adresser, (fx /search/search istedet for index.php?s=search). http://www.ajalapus.com/downloads/search-permalink/ […]

  10. freetemplatesformyspace.com Avatar

    Great little plugin thanks!

  11. […] Search Permalink is a quick hack to modify your search forms for more readable URL’s […]

  12. […] Search Permalink Search Permalink redirects search form queries to cruft-free permalink URIs. (tags: wordpress+plugin) […]

  13. […] WordPress DK anbefales det at anvende pluginet Search Permalink, men pluginet Nice Search kan ogsÃ¥ anvendes. Det er et spørgsmÃ¥l om smag og behag, hvilket […]

  14. […] Search Permalink Omdanner søgningernes adresser til søgemaskinevenlige adresser, (fx /search/search istedet for index.php?s=search). http://www.ajalapus.com/downloads/search-permalink/ […]

  15. Bilgidepom Avatar

    Using on my site now, thank you aja!

  16. Matt Avatar
    Matt

    Any chance of having a Search Permalink like: mysite.com/<KEYWORDS> instead of mysite.com/search/<KEYWORDS>?

    Where <KEYWORDS> are keywords. Examples:

    1. mysite.com/wordpress+plugins
    2. mysite.com/chocolate+cake+easy
  17. Aja Avatar

    No, Matt. Sorry.

    The “power” of my plugin relies on WordPress’ internal permalink handling, which uses /search/ to determine keywords and /page/ to determine pages. Since what you wanted interferes with how WordPress handles the quasi-static Pages’ permalinks—whose keyword/slug appears just below the root—it could be difficult to implement.

    Anyway, you are free to modify mine to suit your needs. I think you’ll need Apache mod_rewrite for that one.

  18. Matt Avatar
    Matt

    Yeah, I managed to get the search like I wanted but it got messed with WP static pages, which means 404 not found.

    Now I need to find a way of showing static pages as “www.mysite.com/static/about” instead of “www.mysite.com/about”. Any tip? 🙂

  19. Matt Avatar
    Matt

    Nevermind. Got it working doing some tricks with Redirections plugin: http://urbangiraffe.com/plugins/redirection/

    Thanks anyway! 😉

  20. zhrance Avatar

    Your plugin works great for Firefox but doesn’t funtion in IE7 are you going to fix this? Because this is a great solution for me except that IE7 ain’t working 🙁

  21. Aja Avatar

    @zhrance: I’ve managed to test it on IE7 and it works on the server-side. What’s seems to be the problem on your part? Maybe I could resolve it with a little more detail. 🙂

  22. zhrance Avatar

    Hey Aja, sorry for my late reply. My major problem is that my search funtion doesn’t work at all, well atleast I got a permalink problem (has something to do with ISAPI Rewrite). I activated again your plugin-in on my blog. If you open my blog (www.plakballen.nl) in Firefox and you type in “Kate” on the right where my search funtion is located everything seems to work fine, if you now do the same thing in IE7 it’s not going to work? I hope you can help me you are my last solution to get my search funtion working. if you need more detailed information let me know!

  23. zhrance Avatar

    Hi Aja, I am still strugeling with my search funtionality. tryed almost every search related plug-in I could find in the WordPress database, nothing brings me a solution. I really hope you can help me out!

  24. Aja Avatar

    I still don’t know what the problem is. I searched for “kate” on your blog using IE7 and received two good matches (Winslet and Hudson). It even made use of the “search permalink” URL style (i.e., http://www.plakballen.nl/search/kate). So, I’m assuming nothing has gone wrong. 🙂

  25. zhrance Avatar

    Well Aja, in the mean time I searched for other solutions and I found a topic about the friendly search url on this blog.

    http://alexking.org/blog/2007/08/30/friendly-search-urls (I also saw you replied on it).

    I am recently using now this solution because it works out for me, so yes it works now in IE7 😉 Only got one issue left maybe you can help me out with that…

    The url structure is now plakballen.nl/search/searchterm, I would love to change the word “search” by “zoek” (dutch translation for search). Do you know how I can do that?

  26. Aja Avatar

    Oh. Sorry I wasn’t able to help you with that. Hmm. I think a L10n setting should take care of that. But, I’m not entirely sure how to apply L10n with WordPress, for the default English is enough for me.

    In any case, it could probably be solved by using rewrite rules to redirect zoek to internal search URLs. But, all I know is Apache’s mod_rewrite and not IIS’s ISAPI_Rewrite engine as you have mentioned earlier, if there’s even significant difference among the two. And, that possible L10n solution would be much proper, IMO.

  27. Michelle Avatar

    Hi, I love your plugin and it works great. Except that on a particular site I have, it is common for people to search for terms with a “/” (forward slash) in them – for example part numbers in this industry are often written this way. This causes a nasty 404 error (which doesn’t default to WP’s 404). Any ideas how to overcome this? Because otherwise, this plugin does exactly what I want! Thanks.

  28. Michelle Avatar

    anyone have any ideas how to handle search queries that include a forward slash?

  29. Dubai Web Design, Development Avatar

    i think to get these kind of plug-in is not easy but you make our job easier. Still searching for more advance plug-in. Does any body knows about that. Will this plug-in support large database ?

  30. Jens Wedin Avatar

    Howdy, I’m trying out this plugin on one of my sites and it works nicely except that it makes the pages loading really slow. I have to wait about two seconds for every page (using firefox firebug to debug) to load. When I turn off the plugin the pages load fast again. Is this a “feature” or a bug?
    Cheers,
    Jens

  31. Aja Avatar

    Jens, the plugin loads a client-side script to eliminate the need for the server to do the redirection if the user has JavaScript enabled. That may have contributed to the extra time the page will have loaded.

    I haven’t been updating my plugins in a while as I have loads of schoolwork to do, but I sure hope I could optimize them soon. Sorry for that little problem.

  32. Daidaros Avatar

    I think this is a great plugin! Very usable. But I have a question for you: Is there an option to change the word “search” for another like “buscar”?

    My first language is spanish and the first language of my visits is spanish too, so I will greatful that.

  33. Aja Avatar

    Daidaros, this plugin uses WordPress’ internal URL/Permalink structure to fetch posts. It merely redirects the visitor’s browser to a URL that is more aesthetically pleasing (e.g., http://example.com/search/search+query/) than a regular search query (e.g., http://example.com/?s=search+query) when entered from a search form. Sorry about that.

  34. Jehzeel Laurente Avatar

    @Daidaros – you can manually rename the word “search” to “buscar” inside search-permalink.php. You need to change the word “search” in line 68 and line 83. 🙂 You can rename it, but after you try searching, it’s a 404..

    wooooot!

  35. […] Search Permalink: Bu eklenti sayesinde site içi arama baÄŸlantılarını daha kolay anlaşılabilir bir hale getireceÄŸiz. Özetle http://www.webmaster.web.tr/index.php?s=seo&option=com_search şeklinde bir adres yerine http://www.webmaster.web.tr/search/seo ÅŸeklinde bir yapıya kavuÅŸacak siteniz. […]

  36. Daidaros Avatar

    @Jehzeel Laurente: Oh, yes, I did it 🙁

  37. Pande Avatar

    Hi Aja, is the redirection Google friendly?
    I mean: is the plugin doing a 301 from /?s= to /search/….?

    If not: HOw can I do it?

    Thanks

  38. Federico Avatar
    Federico

    It seems a very useful plugin. Just a few questions:

    1) Which is the latest WP version your plugin is compatible with? (in WP plugin page it reads “Compatible up to: 2.2.2”)

    2) Can the search results be paged ?

    3) Can I attribute custom templates to the search results?
    I apologize to you if it is off-topic, what I need to create on my website are links pointing search results, i.e.
    http://example.com/search/rome
    http://example.com/search/venice etc..
    with each page displaying search results coming with its own template (so ‘rome’ page different from ‘venice’ page etc…)
    If I create a page ‘http://example.com/search/rome’ in WP with its own template, is it going to incorporate the search results when I perform a search for keyword ‘rome’ — once I installed your plugin — ?

    Many Thanks

  39. […] nomor 2 dan 3 adalah format permalink s?= versi baru. Sy memanfaatkan plugin search permalink wp untuk mengubahnya menjadi lebih human friendly. Efeknya ? nambah lagi redirection sehingga akses […]

  40. Ferri Avatar

    Can We Change /search/ permalinks to another links?

    Example :
    domain.com/search/keyword+keyword2
    Change To
    domain.com/file/keyword+keyword2

    Can we do this? Please Tell me..
    I was try to change but the page display 404

  41. mesonto Avatar
    mesonto

    Any plans to make your plugin work with WordPress v2.8? As of now I receive “internal service error” with your plugin enabled.

  42. sandrar Avatar

    Hi! I was surfing and found your blog post… nice! I love your blog. 🙂 Cheers! Sandra. R.

Leave a Reply

Your email address will not be published. Required fields are marked *