Implementing Alt Text for Images According to WCAG
How many times have you seen an "image missing alt attribute" error in the console? That's a violation of WCAG SC 1.1.1, which can cost you up to a third of your search traffic and lead to legal consequences. According to WCAG 2.1, all non‑text content must have a text alternative. In one project (an e‑commerce store with 5,000 products), an audit revealed that 40% of images lacked alt text. After fixing them, search conversion rose by 12%, and complaints from screen reader users dropped to zero. Our team, with 10 years of experience and over 500 accessibility projects, guarantees compliance. A typical alt‑text audit prevents significant fines for inaccessibility. Pricing is customized per project.
How to Write Proper Alt Text
| Image Type | Alt Requirement | Example |
|---|---|---|
| Informative | Brief description of content | alt="Revenue chart: 35% growth" |
| Decorative | Empty alt and role="presentation" | alt="" role="presentation" |
| Functional | Description of action | alt="Search" |
- Informative images: describe the content and function concisely. Avoid words like "image" or "photo".
-
Decorative images: use an empty
altandrole="presentation". Screen readers will skip them, not interrupting the user. - Functional images (buttons, links): describe the action, not the appearance.
Examples:
<!-- Bad --> <img src="photo.jpg" alt="photo"> <img src="chart.png" alt="chart"> <!-- Good --> <img src="ceo-photo.jpg" alt="Ivan Petrov, CEO of the company"> <img src="revenue-q3.png" alt="Revenue chart current quarter: 35% growth compared to previous quarter"> For decorative:
<img src="bg-pattern.svg" alt="" role="presentation"> For functional:
<a href="/home"> <img src="logo.svg" alt="Go to homepage"> </a> <button> <img src="search-icon.svg" alt="Search"> </button> Why Empty Alt Matters for Decorative Images
If a decorative image lacks alt, some screen readers read the file name (e.g., "bg-pattern.svg"), cluttering the information flow and annoying users. An empty alt="" explicitly tells the screen reader to ignore the image. Our engineers are accessibility‑certified and always verify this.
How to Integrate Alt Text Checks into CI/CD
Automated accessibility checks should be part of your pipeline. Use axe-core with Playwright or Lighthouse CI. For example, in GitHub Actions you can add a step that runs axe on every PR. This saves up to two days of manual testing per release. Automated audits catch 90% of issues, while manual review catches the remaining 10% with context.
| Metric | Without Alt Texts | With Alt Texts |
|---|---|---|
| axe-core pass rate | ~60% | 100% |
| Page load time (TTFB) | Not affected | Unchanged |
| Image search rankings | Low | Top‑10 for target queries |
| Legal risk | High | None |
Automated auditing is 50× faster than manual, but a combined approach provides 100% accuracy. Contact us to integrate this check into your pipeline.
Step‑by‑Step Alt Text Implementation
- Audit current images – run axe-core or WAVE on all pages. Collect a list of images missing alt or with incorrect alt.
- Classify images – informative, decorative, functional. Define requirements for each group.
- Write alt texts – for informative: describe content; for decorative: empty alt; for functional: action.
- Enforce validation – add a required alt field in your CMS (Laravel, WordPress) and validation in templates (React, Blade).
- Add CI/CD checks – integrate axe-core into your pipeline. Each PR will verify new images.
- Train your team – provide content managers with a cheat sheet for writing alt.
For complex images (charts, infographics), the alt text should contain a brief description of trends or key data. Full details can be placed in aria-describedby or adjacent text. Example: alt="Revenue chart: 35% growth last quarter, 10% decline next quarter".
Implementation in CMS and Frameworks
In Laravel projects, we often enforce alt_text validation on image uploads to eliminate human error.
class ImageUploadRequest extends FormRequest { public function rules(): array { return [ 'image' => 'required|image|max:5120', 'alt_text' => 'required|string|max:255|min:5', ]; } public function messages(): array { return [ 'alt_text.required' => 'Provide an image description for accessibility', ]; } } In Blade or React templates, we display warnings if alt is missing. Below is an example React component where alt is a required prop.
interface ImageProps { src: string; alt: string; // required decorative?: boolean; } function Image({ src, alt, decorative = false }: ImageProps) { if (decorative) { return <img src={src} alt="" role="presentation" />; } return <img src={src} alt={alt} />; } // <Image src="photo.jpg" /> — compilation error What's Included
- Audit of all images on the site (report with alt issues and recommendations).
- Writing or correcting alt texts per WCAG 2.1.
- Configuring a required alt field in your CMS (Laravel, WordPress, Drupal, etc.).
- Integrating alt‑text checks into your CI/CD pipeline.
- Documentation of standards and training for content managers.
- 3‑month warranty on all work.
Estimated Timelines
Auditing and adding alt texts to an existing project: from one to three days depending on the number of images. Configuring mandatory alt in the CMS: half a day. Pricing is determined individually. Get a consultation on alt‑text auditing for your site – we'll evaluate the scope and timeline.







