I’m trying modify some urls (on a wordpress website) by adding a css ID at the end:

So for ex: www.mywebsite.com/test/?pa_gender=male

should become: www.mywebsite.com/test/?pa_gender=male#mycustomid

Basically what im looking for is all urls that start with:


to get a css id at the end like this:


Any suggestions on how to achieve this? I guess it should be possible doing this with a custom php function?

Read more here: modify urls adding a css id at the end


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: