Redundant alt text occurs when an image's alternative text repeats information that's already present in the surrounding content. While having alt text is important, redundancy can create a poor experience for screen reader users.
Redundant alt text happens when the same information is repeated in both the alt attribute and nearby text content. Here are some examples:
1 2 3 4 5 6 7 8 9 10 11
<!-- Redundant Alt Text --> <p>Click the download button to get started</p> <img src="download.png" alt="Click the download button to get started"> <!-- Better Approach --> <p>Click the download button to get started</p> <img src="download.png" alt="Download button" role="img"> <!-- Decorative Image --> <p>Click the download button to get started</p> <img src="download-icon.png" alt="" role="presentation">
Redundant alt text affects your website in several ways:
Accessibility Impact
Content Quality Issues
Technical Consequences
First, identify redundant descriptions:
1 2 3 4 5 6 7 8 9
// Function to detect potentially redundant alt text function findRedundantAltText() { const images = document.querySelectorAll('img[alt]'); return Array.from(images).filter(img => { const alt = img.getAttribute('alt').toLowerCase(); const parentText = img.parentElement.textContent.toLowerCase(); return parentText.includes(alt) && alt.length > 5; }); }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!-- Before: Redundant --> <div> <p>Learn more about our services</p> <img src="arrow.png" alt="Learn more about our services"> </div> <!-- After: Optimized --> <div> <p>Learn more about our services</p> <img src="arrow.png" alt="Right arrow" role="img"> </div> <!-- After: Decorative --> <div> <p>Learn more about our services</p> <img src="arrow.png" alt="" role="presentation"> </div>
1 2 3 4 5 6 7 8 9 10 11 12
function SmartImage({ src, alt, context, isDecorative }) { if (isDecorative) { return <img src={src} alt="" role="presentation" />; } // Check if alt would be redundant with context const finalAlt = context?.toLowerCase().includes(alt.toLowerCase()) ? '' // Make decorative if redundant : alt; return <img src={src} alt={finalAlt} role={finalAlt ? 'img' : 'presentation'} />; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<template> <img :src="src" :alt="computedAlt" :role="role" > </template> <script> export default { props: { src: String, alt: String, context: String, isDecorative: Boolean }, computed: { computedAlt() { if (this.isDecorative) return ''; if (this.context?.toLowerCase().includes(this.alt.toLowerCase())) return ''; return this.alt; }, role() { return this.computedAlt ? 'img' : 'presentation'; } } } </script>
Content Assessment
Implementation Guidelines
Quality Control
Indexguru's SEO Analyzer
Accessibility Tools
Development Tools
1 2 3 4 5 6 7 8 9 10 11
<!-- Bad --> <a href="/home"> <img src="home.png" alt="Click here to go to home page"> Home </a> <!-- Good --> <a href="/home"> <img src="home.png" alt="" role="presentation"> Home </a>
1 2 3 4 5 6 7 8 9 10 11
<!-- Bad --> <div> <img src="product.jpg" alt="Blue t-shirt with white logo"> <h2>Blue t-shirt with white logo</h2> </div> <!-- Good --> <div> <img src="product.jpg" alt="Product front view"> <h2>Blue t-shirt with white logo</h2> </div>
1 2 3 4 5 6 7 8 9
<!-- Bad --> <div> <img src="separator.png" alt="Decorative line separator"> </div> <!-- Good --> <div> <img src="separator.png" alt="" role="presentation"> </div>
Optimizing alt text leads to:
While providing alt text is crucial for accessibility, avoiding redundancy is equally important. By following these guidelines and regularly auditing your alt text, you can create a more efficient and accessible website experience for all users.
Need help optimizing your website's alt text and accessibility? Try Indexguru's SEO tools to automatically analyze alt text quality and get actionable recommendations for improvement.
Takes 5 minutes to setup