Programming

SEO Best Practices for Web Developers

Seo best practics img
Table of Contents

You built a fast, clean, good-looking website. Three months later it has 11 visitors, and nine of them were you. The site is not broken. Google simply never understood what it was about.

SEO is often handed to the marketing team, but a large part of it is purely a developer’s job: markup, URLs, speed, structured data, redirects. This guide covers exactly those parts, with code you can copy, free tools you can open right now, and a checklist you can tick off.

What is in this guide (12 minute read):

✓ How Google actually finds and ranks a page, as a diagram
✓ A tickable developer SEO checklist with a live score
✓ A Google result preview tool: type your title and description, see how it will look
✓ Copy-ready code for semantic HTML, structured data, sitemaps, canonicals and images
✓ The real Core Web Vitals numbers to hit
✓ Every tool named here, with a direct link, marked free or paid

Three Jobs, Not One

Before any technique, understand the pipeline. Google has to do three separate things with your page, and each one can fail on its own.

1. CRAWL Can the bot reach your page at all? 2. INDEX Does it understand what the page is about? 3. RANK Is it the best answer, and fast enough? robots.txt · sitemap links · status codes semantic HTML · headings title · structured data content quality · speed mobile · links to you Fail stage 1 and nothing else matters. Most “SEO problems” are really stage 1 or 2.

The first two stages are almost entirely the developer’s responsibility. That is the part of SEO you can fix with code this afternoon.

TICK AS YOU GO

The Developer SEO Checklist

Here is every item this guide covers. Tick the ones your site already does, and watch your score. Everything unticked is explained further down.

0 of 12 done

1. Write HTML That Explains Itself

A page built from nothing but <div> tells a machine nothing. Semantic tags label the parts of your page so both search engines and screen readers know what they are looking at.

MEANINGLESS
before
<div class="top">
  <div class="menu">...</div>
</div>
<div class="content">
  <div class="big">Title</div>
  <div>Text...</div>
</div>
<div class="bottom">...</div>
MEANINGFUL
after
<header>
  <nav>...</nav>
</header>
<main>
  <article>
    <h1>Title</h1>
    <p>Text...</p>
  </article>
</main>
<footer>...</footer>

Same page, same design. Only the right-hand version can be understood without guessing.

Headings are an outline, not a font size

Think of your headings as a tree. One H1 is the trunk, H2s are branches, H3s grow off those. Never pick a heading level because of how big it looks; that is what CSS is for.

CORRECT — an outline H1  SEO for Web Developers H2  Semantic HTML H3  Heading order H2  Core Web Vitals H3  LCP H3  INP WRONG — chosen by size H1  SEO for Web Developers H1  Semantic HTML H4  Heading order H3  Core Web Vitals H6  LCP Three H1s, skipped levels, no structure
TRY IT

2. Your Title and Description, Previewed Live

The title tag and meta description are what people actually read in search results. Type yours below and see how it will look, with warnings when they are too long to fit.

 
 
🔍  seo best practices for developers
index.html  —  the head tags that matter
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Keep under about 60 characters so it is not cut off -->
  <title>SEO Best Practices for Web Developers (2026 Guide)</title>

  <!-- Under about 155 characters. This is your advert. -->
  <meta name="description" content="Practical SEO for developers: semantic HTML,
        structured data, sitemaps and Core Web Vitals, with copy-ready code.">

  <!-- The one correct address for this page -->
  <link rel="canonical" href="https://example.com/blog/seo-for-developers">

  <!-- How it looks when shared on social media -->
  <meta property="og:title" content="SEO Best Practices for Web Developers">
  <meta property="og:description" content="Semantic HTML, schema, sitemaps and speed.">
  <meta property="og:image" content="https://example.com/images/seo-cover.jpg">
</head>

Google may rewrite your description. It often shows a snippet from your page instead, if that matches the search better. Write one anyway: it is the version shown most of the time, and it is what appears when people share your link.

3. URLs People Can Read

AvoidUseWhy
/?p=2784/blog/seo-for-developersWords in the URL describe the page before anyone clicks.
/Products/Best_Widgets/products/best-widgetsLowercase, and hyphens rather than underscores.
/page1/page2/page3/item/shop/itemShallow is easier to crawl and to share.
Changing URLs on a whimKeep them, or 301 redirectA changed URL with no redirect throws away everything that page earned.

WordPress users: go to Settings → Permalinks and choose Post name. If you are changing an existing site, set up 301 redirects from the old URLs first with a plugin, or you will lose the traffic those pages already have.

4. Structured Data: Speak Google’s Language

Structured data is a small block of JSON that tells search engines exactly what your page contains: this is an article, written by this person, on this date. It is what produces star ratings, FAQ drop-downs and recipe cards in the results.

JSON-LD — paste before </body>
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "SEO Best Practices for Web Developers",
  "description": "Semantic HTML, structured data, sitemaps and Core Web Vitals.",
  "image": "https://example.com/images/seo-cover.jpg",
  "datePublished": "2026-10-17",
  "dateModified": "2026-10-17",
  "author": {
    "@type": "Person",
    "name": "Muhammad Azeem",
    "url": "https://example.com/about"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Azeem Tech Studio"
  }
}
</script>

Add an FAQ block and your questions can appear directly in the results:

JSON-LD — FAQ
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [{
    "@type": "Question",
    "name": "How long does SEO take to work?",
    "acceptedAnswer": {
      "@type": "Answer",
      "text": "Usually three to six months for a new site."
    }
  }]
}
</script>

Here is the difference it makes in the results:

https://example.com › blog › plain-result
A page with no structured data
Just a title and a description. Nothing wrong with it, but nothing extra either.
https://example.com › recipes › chicken-karahi
Chicken Karahi Recipe (Ready in 35 Minutes)
★★★★★ Rating: 4.8 · 214 reviews · 35 min · 480 calories
A quick chicken karahi with tomatoes, ginger and green chillies…

The second result takes up more space and gets more clicks, from the same ranking position (illustration).

Check your markup before you trust it: paste a URL into Google’s Rich Results Test (free). To find the right @type for your content, browse schema.org.

5. Speed: The Three Numbers That Count

Google measures real visitors’ experience with three metrics, the Core Web Vitals. These are the current targets, measured on mobile:

MetricWhat it measuresGoodPoor
LCP
Largest Contentful Paint
How long until the main content appears2.5 s or lessover 4 s
INP
Interaction to Next Paint
How quickly the page responds when tapped200 ms or lessover 500 ms
CLS
Cumulative Layout Shift
How much the page jumps around while loading0.1 or lessover 0.25

Run your page through PageSpeed Insights (free) and you will see something like this:

pagespeed.web.dev  |  example.com/blog/seo-for-developers📱 Mobile
94PerformanceGood
100AccessibilityGood
78SEONeeds work
Core Web Vitals
🟢 LCP  1.9 s    🟢 INP  120 ms    🔴 CLS  0.28
Opportunity: images without width and height are causing layout shift

An illustration of a PageSpeed report. The red CLS here is the single most common developer mistake, and section 6 fixes it.

6. Images: The Biggest Easy Win

Images are usually the heaviest thing on a page and the most common cause of a bad score. Four attributes fix almost everything:

The image tag, done properly
<!-- Modern format first, with a fallback for old browsers -->
<picture>
  <source srcset="/img/office.webp" type="image/webp">
  <img src="/img/office.jpg"
       alt="Developer reviewing a website audit on a laptop"
       width="1200" height="800"
       loading="lazy"
       decoding="async">
</picture>

<!-- The image at the top of the page is the exception: -->
<!-- never lazy-load it, it is usually your LCP element -->
<img src="/img/hero.webp" alt="..." width="1600" height="900" fetchpriority="high">
AttributeWhat it does for you
altDescribes the image for screen readers and search engines. Describe the picture, do not stuff keywords.
width and heightReserves the space before the image loads, which stops the page jumping. This is your CLS fix.
loading="lazy"Images below the fold load only when the reader scrolls to them.
fetchpriority="high"Tells the browser to load your main image first, which improves LCP.

Compress before you upload. Squoosh and TinyPNG are free and run in your browser. A 500 KB photo usually drops to about 80 KB as WebP with no visible difference. On WordPress, a plugin can convert your whole media library at once.

7. Sitemap, robots.txt and Canonicals

robots.txt — who may crawl what

/robots.txt
User-agent: *
Allow: /
Disallow: /wp-admin/
Disallow: /cart/
Disallow: /*?s=

Sitemap: https://example.com/sitemap.xml

The most expensive one-line mistake in SEO is leaving Disallow: / in robots.txt after launch. It blocks your entire site. Check yours at yoursite.com/robots.txt right now. In WordPress, also confirm that Settings → Reading → Discourage search engines is unticked.

sitemap.xml — the list of pages you want found

/sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-10-17</lastmod>
  </url>
  <url>
    <loc>https://example.com/blog/seo-for-developers</loc>
    <lastmod>2026-10-17</lastmod>
  </url>
</urlset>

Keep <loc> and <lastmod>, and do not bother with <priority> or <changefreq>; Google ignores them. Submit the sitemap once in Google Search Console and again in Bing Webmaster Tools. In WordPress, an SEO plugin generates the sitemap for you.

Canonical tags — one page, one address

The same content often sits at several addresses: with and without www, with a tracking parameter, with a trailing slash. A canonical tag tells Google which one counts, so your ranking is not divided between them.

In the <head> of every page
<link rel="canonical" href="https://example.com/products/best-widgets">

<!-- All of these should carry the canonical above: -->
<!-- example.com/products/best-widgets?ref=facebook -->
<!-- www.example.com/products/best-widgets           -->
<!-- example.com/products/best-widgets/              -->

8. HTTPS, Redirects and a Useful 404

HTTPS is not optionalBrowsers mark plain HTTP pages as “Not secure”, and it is a ranking signal. Free certificates come from Let’s Encrypt, and almost every host now enables them in one click.letsencrypt.org ↗
301, not 302Moving a page? A 301 is permanent and passes the page’s earned ranking to the new URL. A 302 is temporary and does not. Use 301 unless you genuinely mean “this is coming back”.
A 404 that helpsReturn a real 404 status, then offer a search box, your most popular posts and a link home. Never redirect every missing page to the homepage; that confuses visitors and crawlers alike.
One language per pageSet <html lang="en">. If you publish in more than one language, use hreflang tags so each version is shown to the right audience.
.htaccess — force HTTPS (Apache)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

9. Check Your Work in Search Console

Google Search Console is free, and it is the only place that shows you what Google actually thinks of your site. Verify your domain, submit your sitemap, then check it once a week.

Google Search Console  |  example.comLast 28 days
1,284Total clicks
38.4KImpressions
3.3%Average CTR
18.7Average position
Pages
🟢 Indexed  42
🟡 Crawled, currently not indexed  7
🔴 Excluded by ‘noindex’ tag  3  ← check these are meant to be hidden

An illustration of the Search Console overview. The three numbers worth watching are impressions, average position and indexed pages.

Quick test any time: search Google for site:yoursite.com. If your pages are not listed there, nothing else in this guide matters yet. Start with Search Console’s URL Inspection tool to find out why.

BOOKMARK THESE

Free, and genuinely essential

Google Search ConsoleShows what you rank for, which pages are indexed, and every crawl error. If you only use one tool, use this.search.google.com/search-console ↗
PageSpeed InsightsYour Core Web Vitals, from real visitors plus a lab test, with a list of exactly what to fix.pagespeed.web.dev ↗
Rich Results TestChecks whether your structured data is valid and which rich result it qualifies for.search.google.com/test/rich-results ↗
Lighthouse (in Chrome)Built into DevTools. Press F12, open the Lighthouse tab, run a mobile report. No account needed.developer.chrome.com ↗
Google AnalyticsWhere your visitors come from and what they do once they arrive.analytics.google.com ↗
Bing Webmaster ToolsThe same idea as Search Console, for Bing. Takes five minutes and includes free keyword data.bing.com/webmasters ↗
Schema.orgThe full reference for every structured data type, from Recipe to LocalBusiness.schema.org ↗
Google Search CentralGoogle’s own documentation. When advice online contradicts itself, this is the tiebreaker.developers.google.com/search/docs ↗
Squoosh & TinyPNGCompress and convert images to WebP in the browser, free, no upload limits to worry about.squoosh.app ↗   tinypng.com ↗

Free tier, paid for more

Screaming Frog SEO SpiderCrawls your whole site like a search engine and lists broken links, missing titles and duplicate content. Free up to 500 URLs.screamingfrog.co.uk ↗
Ahrefs Webmaster ToolsA free site audit and backlink view for sites you own. The full Ahrefs suite is paid.ahrefs.com/webmaster-tools ↗
UbersuggestKeyword ideas and competitor checks, with a few free searches a day.neilpatel.com/ubersuggest ↗
AnswerThePublicTurns a keyword into the real questions people search for. Excellent for planning an FAQ section.answerthepublic.com ↗
GTmetrixA second opinion on page speed, with waterfall charts showing what loads when.gtmetrix.com ↗
MozFree MozBar extension and limited free tools; keyword and link research are paid.moz.com/free-seo-tools ↗
AhrefsThe strongest backlink database, plus keyword research, rank tracking and site audits.ahrefs.com ↗
SemrushAn all-in-one marketing suite: SEO, ads, content and competitor research in one place.semrush.com ↗
SitebulbTechnical audits with explanations of why each issue matters. Popular with developers.sitebulb.com ↗

WordPress plugins

Yoast SEOTitles, meta descriptions, sitemaps, canonicals and schema, with a readability check. Free version is enough for most sites.yoast.com ↗
Rank MathThe main alternative to Yoast. More features in the free version, including schema types and redirect management.rankmath.com ↗
RedirectionManage 301 redirects and watch your 404s from inside WordPress. Install it before you change any URLs.wordpress.org/plugins/redirection ↗

Install one SEO plugin, not two. Yoast and Rank Math both write title tags, canonicals and schema. Running both produces duplicate tags and conflicting output. Pick one.

Mistakes That Quietly Cost You Traffic

MistakeFix
Site launched with crawling still blockedCheck /robots.txt and the WordPress “Discourage search engines” setting on launch day.
Every page sharing one titleGive each page a unique title and description written for a human.
Images with no width or heightAdd both. This is usually the whole of a bad CLS score.
URLs changed with no redirects301 every old URL to its new home before you publish the change.
Keyword stuffing in alt text and headingsWrite for people. Describe the image, and let the heading say what the section is about.
Content only appearing after JavaScript runsMake sure the important text is in the HTML. Use server rendering where your framework offers it.
Checking only on desktopGoogle ranks using the mobile version of your page. Test mobile first, always.

Common Questions

How long does SEO take to show results?

For a new site, usually three to six months before meaningful traffic arrives, and sometimes longer in competitive areas. Technical fixes like unblocking crawling or repairing broken redirects can show up within days. Anyone promising page one in a week is selling something.

Are meta keywords still a thing?

No. Google stopped using the meta keywords tag many years ago because it was abused. You can safely delete it. The tags that matter are title, description and canonical.

Do I need an SEO plugin if I hand-code my site?

No. A plugin just writes tags for you. If you control your own HTML, add the title, description, canonical and JSON-LD yourself, and generate a sitemap in your build step. That is all a plugin does.

Does page speed really affect ranking?

Yes, though less than content quality. Speed matters most as a tiebreaker between similar pages, and it has a large effect on whether visitors stay at all. A slow page loses people before it ever gets a chance to rank.

What about AI answers in search results?

Search engines increasingly summarise answers directly on the results page, which means fewer clicks for simple factual queries. The response is the same work as always: be the page that actually answers the question, use clear structure and structured data so your content can be understood, and build depth that a two-line summary cannot replace.

Should I buy backlinks?

No. Paid link schemes are against Google’s spam policies and can get a site penalised. Earn links by publishing things worth linking to, and by being active where your audience already is.

Read next: Mastering Web Performance goes deeper into the speed half of this guide.

Final Thoughts

SEO is not a dark art. For a developer it comes down to a short, practical list: write HTML that explains itself, give every page a real title and address, make it fast on a phone, tell search engines where your pages are, and never block the crawler by accident.

Do one thing right now. Open PageSpeed Insights, run your own site on mobile, and fix the first red item it shows you. Then come back and tick another box on the checklist above. Which item were you missing? Tell me in the comments. I read every one.

If this was useful, share it with a developer whose beautiful site nobody can find.

Share this article

Muhammad Azeem

Written by

Muhammad Azeem

Articles by Muhammad Azeem on azeemtechstudio.com.

Stay Updated

Get the latest coding tutorials, web development tips, AI tools, and technology articles delivered to your inbox.

No spam — we only use your email to send new articles.

Join the Discussion

Your email address will not be published. Required fields are marked *