Important HTML Elements for SEO
- Title Tag: Keep it between 50-60 characters, include important keywords early.
- Meta Description: Aim for ~160 characters, ensure uniqueness for each page.
- Header Tags (H1-H6): Use H1 for the main title, and H2-H6 for structured content.
- Alt Text for Images: Helps with image search rankings and accessibility.
URL Optimization
Common URL Elements
https://store.example.com/category?id=123#top
│ │ │ │ │ │ │
│ │ │ │ │ │ └── Named anchor (jumps to a section)
│ │ │ │ │ └── Query parameter (dynamic content)
│ │ │ │ └── Page slug or subfolder
│ │ │ └── Top-level domain
│ │ └── Root domain
│ └── Subdomain
└── Protocol (HTTPS for security)
Best Practices:
- Choose shorter, human-readable URLs with descriptive keywords.
- Avoid unnecessary parameters in URLs.
- Use descriptive anchor text instead of “click here”.
- Ensure links open directly to the final URL to prevent multiple redirects.
- When using target=“_blank” to open a link in a new tab, make sure you’re implementing rel=“noopener” or rel=“noreferrer” to avoid exposing your website to a surface attack.
- Keep a shallow site structure (important pages should be accessible within a few clicks).
- Implement canonical tags (rel=“canonical”) to prevent duplicate content.
- Use “nofollow” for paid links and distrusted content
- Use “sponsored” for sponsored or compensated links
- Use “ugc” for links within user-generated content
Sitemap and Robots.txt
- Robots.txt : a plain-text file found in the root of a domain and is available for anyone to access from yourwebsite.com/robots.txt. The robots.txt file is stored on the web server, just like other files, and plays a crucial role in guiding web crawlers on how to interact with the site.
- Sitemap.xml :a file that lists all the pages of a website, including their structure and metadata such as the URL, last modified date, and frequency of updates. This structured format makes it easier for search engines to crawl and index the site efficiently.
Handling Redirects and HTTP Status Codes
- 301 Redirects for permanent moves.
- 302 Redirects for temporary changes (use sparingly).
- 404 Error Pages should have useful navigation links to retain visitors.
Ensure all internal links point to the final destination URL to avoid unnecessary redirect chains.
Structured Data and Rich Snippets
Enhance search results and help search engines understand your content.
Popular Formats: JSON-LD, RDFa, Microdata
Common Structured Data Types: Articles, FAQs, Breadcrumbs, Products, Reviews
JSON-LD for schema markup:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "SEO Best Practices",
"datePublished": "2025-02-17",
"author": { "@type": "Person", "name": "Your Name" }
}
</script>
Use semantic HTML5 tags
A semantic element clearly describes its meaning to both the browser and the developer.
Examples of non-semantic elements: <div>
and <span>
- Tells nothing about its content.
Examples of semantic elements: <img>
, <table>
, and <article>
- Clearly defines its content.
Checkout HTML semantics cheat sheet
Image Optimization
Optimizing images is crucial for SEO and performance. Large, unoptimized images slow down your website, negatively impacting both user experience and search rankings.
Here’s how to do it right:
<img
src="url"
alt=""
loading="lazy"
width="100"
height="100"
decoding="async"
draggable="false"
srcset="small.jpg 480w, medium.jpg 1024w, large.jpg 1920w"
sizes="(max-width: 600px) 480px, (max-width: 1200px) 1024px, 1920px"
>
Each attribute serves a purpose:
alt=""
→ Essential for SEO and accessibility. Describes the image for screen readers and search engines.
loading="lazy"
→ Defers image loading until the user scrolls, reducing initial page load time.
width="100" height="100"
→ Helps prevent layout shifts (CLS) by reserving space before the image loads.
decoding="async"
→ Lets the browser decode the image without blocking rendering, improving performance.
draggable="false"
→ Prevents accidental dragging of images, enhancing UX.
srcset
→ Defines multiple image versions (width descriptor helps browsers decide which to load).
sizes
→ Specifies when to use each image (max-width rules adjust based on viewport size).
Using Modern Image Formats: WebP & AVIF
WebP and AVIF provide better compression than JPEG/PNG, leading to smaller file sizes with no quality loss.
Use <picture>
to serve modern formats while ensuring fallback support
Browsers try AVIF first → If unsupported, fall back to WebP → If neither work, use the standard JPEG/PNG.
<picture>
<source srcset="image.avif" type="image/avif">
<source srcset="image.webp" type="image/webp">
<img src="image.jpg" alt="Optimized Image" width="800" height="600">
</picture>
Page Speed Tips
- Minify HTML, CSS, and JavaScript.
- Remove unused CSS.
- Use a CDN for faster global delivery.
- Reduce render-blocking resources and prioritize critical CSS.
Test your Page Speed
- PageSpeed Insights: developers.google.com/speed/pagespeed/insights
- Lighthouse: developers.google.com/web/tools/lighthouse
- GTmetrix: gtmetrix.com
- Unlighthouse: unlighthouse.dev
- WebPageTest: webpagetest.org
- Google Search Console : search.google.com/search-console