I'm having problems redirecting several cases of amp to the canonical non-amp urls. Over the years, I tried different AMP plugins. Namely the official WordPress AMP, AMPforWP, and AMP NINJA.
It's been around 4 years since I used AMP, and all the plugins have been deleted.
When I started seeing a number of pages reported as "Excluded by ‘noindex’ tag" in Google Console I set up some regex directs from the AMP versions to the canonical using the "Redirection" plugin.
Errors I was seeing reported as "Excluded by ‘noindex’ in GSC included:
/my-post/amp /my-post/amp/ /my-post/?wpamp /my-post/amp/?wpamp /tag/my-tag/page/8/?wpamp /cat/my-cat/page/8/?wpamp /tag/my-tag/page/8/amp /cat/my-cat/page/8/amp /tag/my-tag/page/8/amp/ /cat/my-cat/page/8/amp/ ?nonamp=1 ?amp=
The redirects I currently have in place in the "Redirection" plugin are: ^/(.)/?wpamp target= mywebsite.com/$1 ^/(.)/amp (recently edited from "^/(.*)/\amp") target= mywebsite.com/$1
I recently disabled: ^/(.?)/?nonamp=. target= mywebsite.com/$1 ^/(.?)/?amp=. target= mywebsite.com/$1
When I view the log of the last few day in the Redirection plugin I see instances as follows:
/tag/my-tag/?wpamp redirects to mywebsite.com/my-tagtag /my-post/?wpamp redirects to mywebsite.com/my-post /category/my-category/amp/ redirects to mywebsite.com/category/my-category/ /my-post/amp redirects to mywebsite.com/my-post /my-post/amp/ redirects to mywebsite.com/my-post/ /my-post/amp/?wpamp redirects to mywebsite.com/my-post/amp
I can only guess the regex strings are wrong or incomplete, maybe clashing with each other.
Can anyone help?
I'm on Siteground GoGeek hosting. My permalink structure is set to "post name"