We had a version of our website which added a lang query parameter to the end of any URL. It didn't last long as it created lots of duplicate pages... but they still exist in google. I'd like to do a redirect to basically remove ANY of the references.
An example is https://www.example.com/?lang=au
I am using a redirection plugin (wordpress) which supports regex, however I am having trouble with the formatting. It's removing the "Lang" part, but nothing else.
/(.*)\/?lang=*
That should then redirect to
https://www.example.com/$1
So any form eg: example.com/sub-page/something-else/?lang=au would redirect back to example.com/sub-page/something-else/ (minus the lang param).
Thanks for any help!
/(.*)\/?lang=.*