Date First Published: 18th November 2022
Topic: Web Design & Development
Subtopic: SEO
Article Type: Computer Terms & Definitions
Difficulty: MediumDifficulty Level: 6/10
Learn more about what the data-nosnippet attribute is in this article.
Not to be confused with the nosnippet tag.
The data-nosnippet attribute is a HTML attribute used to instruct Google to not use certain textual parts of a HTML page as a featured snippet and a description under the search engine listing. Text found in elements marked with the data-nosnippet attribute with valid HTML and closing tags will not be used as a snippet in the Google search results page. This can be accomplished by adding the attribute to <div>, <span>, and <section> elements. This HTML attribute is different from the nosnippet tag, which is inserted in the head of the HTML document and completely prevents search engines from showing a featured or regular description under the search engine listing, not just certain text. An example of the data-nosnippet attribute can be seen below:
It is not recommended to add or remove the data-nosnippet attribute of existing nodes using JavaScript as this will cause uncertainty when Google renders the page. When using JavaScript to add DOM elements, always include the data-nosnippet attribute when originally adding the element to the DOM of the page.
Similar to the noindex tag instruction, in order for the data-nosnippet instruction to be effective, the page must not be blocked by the robots.txt file. If the web crawler is blocked by the robots.txt file or cannot access the page, the crawler won't see the data-nosnippet instruction and the text can appear as a snippet under the search engine listing.
If an element a website owner is setting to data-nosnippet is already in the search results as a snippet, it might take some time for the text to disappear from the search results as search engine bots will have to recrawl the page to see the data-nosnippet attribute.
Usually, search engine bots automatically choose the most relevant piece of text as a description in the search results or the description can be specified in the meta description tag. Sometimes, website owners want to have a description under their search engine listing, but there are just some pieces of text that they do not want to appear under the search result. The types of text that website owners may not want search engine bots to appear are:
If so, it is important that you tell me as soon as possible on this page.
Network Services Network Setups Network Standards Network Hardware Network Identifiers Network Software Internet Protocols Internet Organisations Data Transmission Technologies Web Development Web Design Web Advertising Web Applications Web Organisations Web Technologies Web Services SEO Threats To Systems, Data & Information Security Mechanisms & Technologies Computer Hardware Computer Software Ethics & Sustainability Legislation & User Data Protection