Change default search string "?s=" to permalink structure?
-
Hi guys,
Ive read a few posts on this and never found a clear and concise easy to understand answer.
What i want to do is change search string URLs from “?s=” to something like /folder/search-term
Where “/folder” would represent “?s=” and “/search-term” would represent the keywords (currently they would be “search+term”)
I think this is possible? Obviously something is currently tell wordpress to display searches as “?s=” so I guess it can be changed.
I dont really want to do it through re-directs though as I want to be done for SEO and indexing reasons primarily as well as it looking nice. It would save me lots of time creating real pages but using my “search.php” to generate the content I need for a large section of the site.
What I also need it to do is make sure that I could link to the permalinks (hence why re-direct wouldn’t work)
So right now I could link to “domain.com/?s=search+term” and it would always return the dynamic page. I want it to be able to link to “domain.com/search/search-term” and it return the same results.
I believe this will take some modification of the WordPress core? Which means id lose it everytime I upgrade correct?
Either that or I can somehow adapt the “nice search” redirect code and do some .htaccess tricks to make it a permanent change? – perhaps the people who understand will be able to answer that better.
There are plugins which will automatically make pages from search results for me which save a lot of time but they cost lots of money (for this one simple job) and it would also add them as physically pages or posts in the admin panel when I dont really want to do that (I dont want to have them editable etc I want them to function just the way they do when you search right now)
Hopefully someone can help!
- The topic ‘Change default search string "?s=" to permalink structure?’ is closed to new replies.