HTML Guides for grammarly
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
A <grammarly-desktop-integration> element sits after the closing </body> tag, where the HTML parser accepts no more elements.
The Grammarly writing assistant adds this element to pages while they are open in a browser where it runs, appending it to the end of the document. It is not part of the site's own markup. It ends up in the source when the markup is copied from that browser instead of from the original file: from the developer tools, through a "save page" command, or through a visual editor that stores the page as the browser displays it. The copied markup carries the injected element along with the real content.
Once the parser has seen </body>, any start tag that follows is a parse error. Browsers recover by moving the element back into <body>, so the page usually looks fine, but the source no longer matches the document browsers build. The element does nothing for visitors who don't run Grammarly, and its data-grammarly-shadow-root attribute only makes sense to the extension that created it.
Fix it by deleting the element from the source, opening and closing tags included. Moving it inside <body> would silence the validator, because a hyphenated name is a valid custom element there, but it would keep markup that doesn't belong to the page. If the page is edited in a visual editor, turn off Grammarly for that editor or check the HTML view before saving, so the element doesn't come back.
Invalid example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Event program</title>
</head>
<body>
<h1>Event program</h1>
<p>Tickets go on sale in March.</p>
</body><grammarly-desktop-integration data-grammarly-shadow-root="true"></grammarly-desktop-integration>
</html>
Valid example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Event program</title>
</head>
<body>
<h1>Event program</h1>
<p>Tickets go on sale in March.</p>
</body>
</html>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries