I am getting the url from the wordpress tags like this
www.xxxxxx.com/?tag=chromatography
but I want like this
www.xxxxxx.com/?s=chromatography
Can anybody tell me how can i change the url setting which generate from the tag?
Any help is appreciable
You can use a URL rewrite (documentation), either in a local
.htaccess
file or your main Apache VirtualHost file (assuming you are using Apache).This should do the trick:
The above means that anyone visiting either
http://yoursite.com/index.php?s=chromatography
orhttp://yoursite.com/?s=chromatography
will see that URL int he address bar, but WordPress will understand it as meaninghttp://yoursite.com/?tag=chromatography
So the tag behaviour will function as expected.
To change the URL which wordpress itself puts out for tags, you can apply a filter, as mentioned in the documentation for
get_tag_link
.For that, add something like the below to your theme’s
functions.php
file:N.B. That PHP code is not tested, but as far as I can tell should do the trick.