Plugin to change URL’s when rendered?
I am looking for a plugin that can manipulate links in posts before they are rendered. I.e. the links entered by the authors are not to be changed, just what is displayed to visitors. Such that if the plugin is disabled or uninstalled the original links, exactly as the authors entered, would be rendered.
Regarding the manipulate functionality the plugin should be able to be configured to do stuff like this:
- If the link is to the domain interestingsitealpha.com, add the query string parameter aid=12345678.
- If the link has a query string parameter of the kind bid=*, remove it.
- If the link is to the domain and path interestingsitebeta.com/coolstuff/, remove all query string parameters.
- If the link is to the domain interestingsitegamma.com, link instead to trackthislink.com?cid=18273645 . With an additional query string did=[ENCODEDORIGLINK] ; where [ENCODEDORIGLINK] is the whole original link url uncoded.
One should be able to change the configuration easily. For example:
- From now on links to interestingsitealpha.com should instead have the path part /12345678/ added right after the domain and port part of the url.
It would of course be an added bonus if these could be given a priority and chained. For Example, remove all query string parameters, add a parameter, now url encode the link and add that as a query string parameter to this other link.
I have only been able to find a couple of solutions that use code. This answer is what I would have used if the end users were programmers https://wordpress.stackexchange.com/a/334879/191871. Alas, they are not.