amp-wp icon indicating copy to clipboard operation
amp-wp copied to clipboard

target="_self" reported as invalid tag attribute in Google Search Console

Open flexdaddy opened this issue 10 years ago • 6 comments

Is there a way to have the plug-in automatically strip out any invalid 'target' attributes on links?

According to the ampproject:

The href attribute value must not begin with javascript:. If set, the target attribute value must be _blank.

Google Search Console has reported content containing anchors with target="_self" as invalid tag attribute values.

flexdaddy avatar Feb 29 '16 15:02 flexdaddy

If you are wordpress users you may add target _blank using this plugin https://wordpress.org/plugins/wp-links/screenshots/

jery61007 avatar Mar 03 '16 15:03 jery61007

Yeah, the wp-amp plugin itself should be stripping those attribute tags though. We shouldn't need to use a separate plugin in order to accomplish what the wp-amp plugin should be taking care of.

kkranzo avatar Mar 03 '16 15:03 kkranzo

Yes and in our case we are small blogging network running MU installation and can't fully control what our users are publishing. Would be nice if wp-amp could just take care of these kinds of issues for us.

I'm finding a number of other validation related issues that I'd expect the plug-in to address. Hopefully the next release will correct some of these.

flexdaddy avatar Mar 03 '16 16:03 flexdaddy

Do you want to replace _self with _blank for both AMP page and your original Webpage ?? @flexdaddy

jery61007 avatar Mar 03 '16 18:03 jery61007

Is _blank the only value that is AMP friendly?

If so, _self and _top should be removed or replaced with _blank by the wp-amp plugin.

kkranzo avatar Mar 03 '16 18:03 kkranzo

yea but the AMP plugin doesn't do that .... we can still get around that issue though

jery61007 avatar Mar 03 '16 18:03 jery61007