Does Google content crawl inside HTML5 tags?

HTML5 template tags should be completely inert, as if the content were not in the source, but is this the case when Google crawls and then indexes a web page?

Does anyone have any data that can somehow prove that Google is indexing or not indexing content in template tags? Template tags are great, but I donโ€™t want to use them if they adversely affect SEO.

+5
source share
2 answers

Today I experienced something that confirms that this affects SEO.

I just received a warning from the Google Search Console about an increase of 404 errors, and almost the entire URL in the error is in this form: /some-path/some-page/$%7Bconsent.infoURL%7D .

Once the URL is decoded, we can see that ${consent.infoURL} is the variable that I use in the template tag, in the href attribute:

 <template data-template="cookie-notice"> `<div data-cookie-notice class="cookie-notice" role="dialog"> <span class="cookie-notice-caption">${consent.captionText}</span> <a class="cookie-notice-link" href="${consent.infoURL}">${consent.linkText}</a> <button data-button-consent type="button" class="cookie-notice-button">${consent.buttonText}</a> </div>` </template> 

So, Google Bot really follows the links in the template tags.

+2
source

I was also interested in this, since I was thinking about using the <template> as a form of server-side rendering or pre-disclosing some content that will be updated via AJAX / JS as soon as the page is ready.

I checked the Google Webmaster Tools Structured Data Tool to see if it would read microdata from the HTML tags placed inside the <template> .

analytics data pattern test tag

As you can see in the screenshot, it seems to read the data inside the <template> . I would not consider this a confirmed answer, but it assumes that the parser (at least when it comes to HTML microdata) does not ignore the content inside the <template> tags.

+1
source

Source: https://habr.com/ru/post/1262135/


All Articles