If you search "how to do SEO" right now, Google returns over 2 billion results. Most of them give you a checklist of 10 tips and call it a day. This guide is different.
By the time you finish reading, you will understand every single on-page SEO element — from the first line of your HTML <head> to the last paragraph in your <body>. You will know exactly why each element matters, how Google interprets it, and what the correct implementation looks like with real code examples.
No fluff. No vague advice. Just the complete picture, in order, from first principles.
What Is On-Page SEO and Why It Matters More Than Ever in 2026
On-page SEO is the practice of optimising individual web pages so that search engines understand their content clearly and rank them for the right searches. Unlike off-page SEO (backlinks, brand mentions, external signals), on-page SEO is entirely within your control. Every title, every heading, every image alt text — you decide what it says.
In 2026, on-page SEO matters more than it ever has for three reasons:
1. Google's AI Overviews have raised the bar for content quality. Pages that rank now must genuinely answer the searcher's intent, not just match keywords.
2. Google's E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness) framework rewards well-structured, semantically rich pages. A page with perfect on-page signals communicates authority to both users and search engines.
3. With the rise of AI-generated content spam, Google is actively filtering for human-quality signals — clear structure, original examples, proper semantic markup — all things that on-page SEO provides.
Let's build your on-page SEO knowledge from the ground up.
Step 1: Keyword Research — The Foundation of Every Page
You cannot write an SEO-optimised page without first knowing which keyword to target. Keyword research is the process of discovering what words and phrases your target audience actually types into search engines when looking for your content, product, or service.
Getting this wrong means writing great content that nobody searches for. Getting it right means every page you publish has a direct path to traffic.
What Is a Keyword?
A keyword is any word or phrase that a user types into a search engine. Keywords are the bridge between what a user wants and what your page offers. Google's entire job is to match those two things. Your job in on-page SEO is to help Google understand what your page offers so it can present it to the right searchers.
The Two Core Types: Short-Tail vs Long-Tail Keywords
Understanding the difference between these two types is fundamental before you write a single word.
Short-Tail Keywords (Head Terms)
Short-tail keywords are broad, short search queries — usually 1 to 2 words long. Examples:
SEOweb developmentdigital marketingPython
Characteristics of short-tail keywords:
| Property | Reality |
|---|---|
| Search volume | Very high (10,000–1,000,000+ searches/month) |
| Competition | Extremely high |
| Ranking difficulty | Very hard (dominated by Wikipedia, big brands, established domains) |
| Conversion rate | Very low (intent is unclear) |
| Time to rank | 12–24+ months even with strong domain authority |
Who should target short-tail keywords? Established websites with high domain authority (DA 60+), large content teams, and long-term brand-building budgets. For most freelancers, small businesses, or new websites — avoid short-tail keywords entirely at the start. You will never rank for them on a new domain.
Example: If you publish a page targeting just SEO, you are competing against Moz, Ahrefs, HubSpot, Google's own documentation, and thousands of high-authority sites. That battle is not winnable for a new domain.
Long-Tail Keywords (Specific Phrases)
Long-tail keywords are longer, more specific search queries — usually 3 to 6+ words. Examples:
how to do on-page SEO for beginners 2026best free keyword research tools in Pakistanon-page SEO checklist for Next.js websitesdifference between long-tail and short-tail keywords
Characteristics of long-tail keywords:
| Property | Reality |
|---|---|
| Search volume | Lower (50–2,000 searches/month each) |
| Competition | Low to medium |
| Ranking difficulty | Much easier — achievable for new sites |
| Conversion rate | High (searcher knows exactly what they want) |
| Time to rank | 3–6 months with good on-page SEO |
The combined power of long-tail: Even though each long-tail keyword has lower volume, research from Ahrefs shows that 70% of all Google searches are long-tail queries. That means the majority of search traffic happens across thousands of specific queries, not a handful of broad ones.
A page targeting on-page SEO checklist for small businesses 2026 can realistically rank on page 1 within 3 months on a new website. A page targeting just SEO cannot rank in the top 10 results for years, if ever.
Real-world example: Instead of targeting web development (90,500 searches/month, KD 85), a Pakistani freelancer should target how to become a web developer in Pakistan 2026 (320 searches/month, KD 12). The second keyword is winnable, has buying-intent visitors, and will start driving traffic within months.
LSI Keywords (Latent Semantic Indexing)
LSI keywords are terms that are thematically related to your primary keyword. Google uses them to understand the full context of your page — not just the exact phrase you're targeting.
Example: If your page targets on-page SEO, Google expects to also see related terms like:
- title tags, meta description, heading tags, image alt text, internal links, keyword density, canonical URL, schema markup
If those contextually relevant terms appear naturally in your content, Google gains confidence that your page genuinely covers the topic. If they are absent, Google may rank the page lower even if the primary keyword appears frequently.
How to find LSI keywords:
- Type your main keyword into Google and scroll to the bottom — "Related searches" shows LSI terms
- Use Google's autocomplete (type keyword + alphabet letters to see suggestions)
- Look at the "People Also Ask" box on Google
- Use a tool like LSIGraph.com (free)
- Read the top 5 ranking pages for your keyword and note which related terms they all use
Keyword Intent: The Most Critical Factor in 2026
Every search query has an intent behind it. Google classifies intent into four categories and rewards pages that match intent perfectly. Misaligning intent is the single biggest reason pages fail to rank despite good on-page SEO.
The 4 types of keyword intent:
1. Informational Intent
The searcher wants to learn something. They are not ready to buy. They want an answer, a guide, or an explanation.
- Examples:
what is on-page SEO,how does Google ranking work,difference between H1 and H2 tags - Best content format: Blog posts, guides, tutorials, how-to articles
- What Google rewards: Comprehensive, well-structured, easy-to-read content with clear answers
2. Navigational Intent
The searcher wants to find a specific website or page.
- Examples:
Ahrefs keyword research tool,Muhammad Shams Paracha portfolio,Supabase documentation - Best content format: Your homepage, about page, or branded landing pages
- What Google rewards: The correct URL for the brand they searched
3. Commercial Investigation Intent
The searcher is comparing options before making a decision. They are close to buying but doing research.
- Examples:
best SEO tools for beginners 2026,Ahrefs vs SEMrush,top on-page SEO plugins for WordPress - Best content format: Comparison articles, listicles, review posts
- What Google rewards: Honest comparisons with clear recommendations
4. Transactional Intent
The searcher is ready to take action — buy, sign up, download, or contact.
- Examples:
hire SEO specialist Pakistan,buy Ahrefs subscription,download SEO checklist PDF - Best content format: Service pages, product pages, landing pages with strong CTA
- What Google rewards: Clear value propositions, trust signals, easy conversion paths
Critical rule: Match your page type to the intent. A blog post will never rank well for a transactional keyword, and a product page will never rank well for an informational one. If your keyword is how to do on-page SEO, write a detailed guide — not a sales page for your SEO services.
How to Find Keywords: Tools and Process
Step 1 — Seed Keyword Brainstorm
Start with 5–10 broad topics related to your page. If you're an SEO consultant, your seed topics might be: on-page SEO, keyword research, meta tags, technical SEO, content strategy.
Step 2 — Use Free Keyword Research Tools
Google Keyword Planner (Free with Google Ads account) The most reliable source for search volume data. Enter your seed keywords and it returns hundreds of related keyword ideas with monthly search volumes, competition levels, and bid estimates.
How to use:
1. Go to ads.google.com → Tools → Keyword Planner
2. Click "Discover new keywords"
3. Enter your seed keyword
4. Filter by country (Pakistan, US, UK, etc.)
5. Export the results to a spreadsheet
6. Sort by "Avg. monthly searches" descending
7. Look for keywords with moderate volume + low competition
Google Autocomplete (Free — no account needed) Type your seed keyword into Google and notice the suggestions that appear. Each suggestion is a real query that many users have typed. These are golden long-tail keywords.
Example:
Type: "on-page seo "
Google suggests:
→ "on-page seo checklist 2026"
→ "on-page seo techniques step by step"
→ "on-page seo examples for beginners"
→ "on-page seo vs off-page seo difference"
→ "on-page seo for small business website"
All of these are real long-tail targets.
People Also Ask (Free) Every Google search results page contains a "People Also Ask" section. Each question in that box is a long-tail keyword with informational intent. They are especially valuable because pages that answer them can win featured snippet positions (the box at the very top of Google results).
Ubersuggest (Free tier available) Enter a keyword and get: search volume, SEO difficulty score, content ideas, and competitor pages. Good for beginners. Go to app.neilpatel.com/ubersuggest.
Ahrefs Free Tools / Keyword Generator (Free) ahrefs.com/keyword-generator gives you keyword ideas with difficulty scores and search volumes without needing a paid subscription. Highly accurate data.
AnswerThePublic (Free limited searches) Visualises all the questions people ask around a topic. Excellent for finding informational intent long-tail keywords for blog content.
Step 3 — Evaluate Keywords Against 3 Metrics
For every keyword you're considering, check:
| Metric | What to look for | Tool |
|---|---|---|
| Monthly Search Volume | At least 50–100 for a new site (higher for established) | Keyword Planner, Ubersuggest |
| Keyword Difficulty (KD) | Under 30 for new sites, under 50 for medium-authority | Ahrefs, Ubersuggest |
| Search Intent | Does it match your page type? | Manual Google search |
Pro tip — the Golden Keyword Formula:
The best keywords to target have: Volume ≥ 100 + KD ≤ 30 + Intent matches your content type + Contains 3+ words.
Step 4 — Keyword Mapping
Keyword mapping means assigning one primary keyword to each page on your website. Every page should target exactly one primary keyword (plus 3–5 related LSI keywords). Two pages targeting the same keyword create keyword cannibalization — they compete with each other, and both rank lower than a single well-optimised page would.
Example keyword map for a portfolio website:
/ → Primary: "IT expert full stack developer Pakistan"
/about → Primary: "Muhammad Shams Paracha professional profile"
/projects → Primary: "SaaS web development projects portfolio"
/blog → Primary: "IT development SEO blog articles"
/blog/this-post → Primary: "complete on-page SEO guide 2026"
/courses → Primary: "online IT digital marketing courses Pakistan"
Step 2: Content Writing for SEO
With your target keyword selected, now write content that both ranks and genuinely helps readers. In 2026, Google rewards content that demonstrates real expertise, not content that just repeats keywords.
The E-E-A-T Framework
Google evaluates pages on four dimensions. Understanding these shapes how you write:
Experience: Has the author actually done what they're writing about? First-hand accounts, real screenshots, personal case studies — these signal genuine experience.
Expertise: Does the author know this topic deeply? Accurate technical details, proper terminology, nuanced explanations — these signal expertise.
Authoritativeness: Is the author known in this field? An author bio, links to credentials, citations from reputable sources — these build authority.
Trustworthiness: Can the reader trust this page? Clear attribution, accurate data, no misleading claims, transparent about the author — these build trust.
Content Structure Best Practices
Well-structured content ranks better and converts better. Follow this structure for any SEO article:
1. Introduction (150–250 words)
- Hook: why this topic matters right now
- Promise: what the reader will gain
- Preview: brief overview of what's covered
2. Main sections (H2 headings)
Each section: 300–600 words, covers one specific aspect
3. Sub-sections (H3 headings)
Break complex H2 sections into digestible H3 chunks
4. Code examples / tables / bullet lists
Use formatting to aid scannability
5. Conclusion (100–150 words)
Summarise key points, call to action
Word Count and Depth
There is no magic word count, but research from SEMrush and Backlinko consistently shows that long-form content (1,500–3,000 words) ranks better for most informational queries. Not because Google counts words, but because comprehensive content naturally covers more related terms, answers more sub-questions, and earns more time-on-page from readers.
Write as many words as the topic genuinely requires. Do not pad. Do not repeat. Do not add sections just to hit a word count.
Keyword Placement in Content
Once you have your primary keyword and LSI keywords, place them naturally:
- Primary keyword: First 100 words of the article, at least 2–3 times in the body, and once in the conclusion
- LSI keywords: Woven naturally throughout — not forced
- Keyword density: 1–2% of total words. More than 3% looks spammy to Google.
Step 3: The HTML <head> — Every Tag That Matters for SEO
The <head> section of your HTML is invisible to users but critical to search engines. Google reads it to understand the page's identity, purpose, and indexing instructions before reading a single word of visible content.
Here is a complete, annotated <head> for an SEO-optimised page in 2026:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<!-- ─── 1. CHARACTER ENCODING ──────────────────────────────── -->
<meta charset="UTF-8" />
<!-- Always first. Tells browser how to decode the page bytes.
UTF-8 supports all languages, symbols, and emojis. -->
<!-- ─── 2. VIEWPORT (MOBILE-FIRST) ────────────────────────── -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Critical for mobile-first indexing. Without this, Google
treats your page as a desktop-only page and ranks it lower
in mobile search results. -->
<!-- ─── 3. TITLE TAG ───────────────────────────────────────── -->
<title>Complete On-Page SEO Guide 2026 | Muhammad Shams Paracha</title>
<!-- The single most important on-page SEO element.
RULES:
- Length: 50–60 characters (longer gets cut off in SERPs)
- Primary keyword: near the beginning of the title
- Brand name: at the end after a pipe |
- Must be unique: no two pages should share a title
- Must match intent: informational titles for guides,
action titles for landing pages
BAD: <title>SEO Tips</title> (too short, no keyword)
BAD: <title>We offer the best SEO services for your website needs</title> (too long, spammy)
GOOD: <title>On-Page SEO Guide 2026: Step-by-Step for Beginners</title> (56 chars, keyword-rich, intent-aligned) -->
<!-- ─── 4. META DESCRIPTION ───────────────────────────────── -->
<meta name="description"
content="Learn complete on-page SEO for 2026 — keyword research, head tags, body structure, image optimisation, schema markup, and internal linking. Real HTML code examples included." />
<!-- The snippet shown in Google search results under the title.
RULES:
- Length: 140–160 characters (longer gets truncated)
- Include primary keyword naturally
- Write for humans, not robots — this is your ad copy
- Each page must have a unique description
- Describe what the reader will get, not what the page is
NOTE: Google may override your description with its own
snippet if it finds a better match in your page content.
That is fine — it means Google found something more relevant.
BAD: "This page is about SEO. We explain SEO here."
GOOD: "Step-by-step on-page SEO guide with code examples — keyword research, title tags, meta, H1-H6, alt text, and schema markup all covered." -->
<!-- ─── 5. CANONICAL URL ───────────────────────────────────── -->
<link rel="canonical" href="https://yoursite.com/blog/complete-on-page-seo-guide-2026" />
<!-- Tells Google which URL is the definitive version of this page.
Why it matters: If your page is accessible at multiple URLs
(http vs https, www vs non-www, /page vs /page?utm_source=x),
Google might split ranking signals across duplicates.
The canonical tag consolidates them to one URL.
Always use your preferred, clean URL.
Always use HTTPS.
Always match the URL in your sitemap.xml. -->
<!-- ─── 6. ROBOTS META TAG ────────────────────────────────── -->
<meta name="robots" content="index, follow" />
<!-- Tells Google's crawler what to do with this page.
"index" = add this page to the search index (show in results)
"follow" = follow the links on this page to find more pages
Other values:
"noindex" — do not show this page in search results
"nofollow" — do not follow links (rare, use carefully)
"noindex, nofollow" — for admin pages, login pages, test pages
Default behaviour (if tag is absent) is index+follow, so
you only need this tag when you want to change the default. -->
<!-- ─── 7. OPEN GRAPH TAGS (Social Sharing) ───────────────── -->
<meta property="og:type" content="article" />
<meta property="og:url" content="https://yoursite.com/blog/complete-on-page-seo-guide-2026" />
<meta property="og:title" content="Complete On-Page SEO Guide 2026 — Step by Step" />
<meta property="og:description" content="The definitive on-page SEO guide for 2026. Keyword research, head tags, body structure, schema markup and real code examples all in one place." />
<meta property="og:image" content="https://yoursite.com/images/on-page-seo-guide-2026-og.jpg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="On-Page SEO Guide 2026 — Complete Step by Step Tutorial" />
<meta property="og:site_name" content="Muhammad Shams Paracha — Blog" />
<meta property="og:locale" content="en_US" />
<!-- Open Graph tags control how your page appears when shared
on Facebook, LinkedIn, WhatsApp, and Slack.
Without these tags, social platforms show a random image
and incorrect title from your page.
The og:image should be exactly 1200×630 pixels for best
display across all platforms. Always include alt text. -->
<!-- ─── 8. TWITTER CARD TAGS ──────────────────────────────── -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Complete On-Page SEO Guide 2026" />
<meta name="twitter:description" content="Keyword research, head tags, body structure, schema markup and code examples — the complete on-page SEO guide for 2026." />
<meta name="twitter:image" content="https://yoursite.com/images/on-page-seo-guide-2026-og.jpg" />
<meta name="twitter:creator" content="@shamsparacha" />
<!-- Controls how your page appears when shared on X (Twitter).
"summary_large_image" = large preview image + title + description
"summary" = small thumbnail + text only
Always use summary_large_image for blog posts. -->
<!-- ─── 9. AUTHOR & PUBLICATION META ──────────────────────── -->
<meta name="author" content="Muhammad Shams Paracha" />
<meta name="article:published_time" content="2026-04-02T09:00:00+05:00" />
<meta name="article:modified_time" content="2026-04-02T09:00:00+05:00" />
<!-- These help Google understand who wrote the page and when.
publication_time / modified_time are especially important
for news articles and timely blog posts — Google uses them
to decide how "fresh" content is. -->
<!-- ─── 10. STRUCTURED DATA / SCHEMA MARKUP (JSON-LD) ─────── -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Complete On-Page SEO Guide 2026: From Keyword Research to Full Technical Implementation",
"description": "The definitive step-by-step on-page SEO guide for 2026 covering keyword research, all head tags, body structure, and real HTML code examples.",
"image": "https://yoursite.com/images/on-page-seo-guide-2026-og.jpg",
"author": {
"@type": "Person",
"name": "Muhammad Shams Paracha",
"url": "https://yoursite.com/about",
"jobTitle": "SEO Specialist & Full Stack Developer",
"address": {
"@type": "PostalAddress",
"addressLocality": "Islamabad",
"addressCountry": "PK"
}
},
"publisher": {
"@type": "Organization",
"name": "Muhammad Shams Paracha Blog",
"logo": {
"@type": "ImageObject",
"url": "https://yoursite.com/logo.png"
}
},
"datePublished": "2026-04-02",
"dateModified": "2026-04-02",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://yoursite.com/blog/complete-on-page-seo-guide-2026"
}
}
</script>
<!-- JSON-LD is Google's preferred format for structured data.
It communicates to Google what TYPE of content this page is:
Article, Product, Person, Event, FAQ, Recipe, etc.
When Google understands the type, it can display rich results:
star ratings, publication dates, author cards, FAQ dropdowns
directly in the search results — dramatically improving CTR.
Types of structured data useful for blogs:
- Article → blog posts, news articles
- FAQPage → FAQ section at the bottom of a page
- BreadcrumbList → navigation breadcrumbs
- Person → author profiles
- WebPage → general pages
- HowTo → step-by-step guide pages -->
<!-- ─── 11. FAVICON & TOUCH ICONS ─────────────────────────── -->
<link rel="icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
<!-- Not directly an SEO ranking factor, but contributes to
brand recognition and CTR. Users can see your favicon
in browser tabs and bookmarks. -->
<!-- ─── 12. PRECONNECT (Performance / Core Web Vitals) ─────── -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<!-- Establishes early connections to third-party servers.
This reduces latency for fonts and external resources,
improving your Largest Contentful Paint (LCP) score —
a Core Web Vitals metric that Google uses as a ranking signal. -->
<!-- ─── 13. HREFLANG (Multi-language sites only) ──────────── -->
<link rel="alternate" hreflang="en" href="https://yoursite.com/blog/on-page-seo-guide" />
<link rel="alternate" hreflang="ur" href="https://yoursite.com/ur/blog/on-page-seo-guide" />
<!-- If your site serves content in multiple languages, hreflang
tells Google which language version to show in which country.
Only add this if you genuinely have translated versions. -->
</head>
That is every important <head> tag, with full explanations. Now let us move to the <body>.
Step 4: The HTML <body> — Semantic Structure That Ranks
The <body> is where your visible content lives. How you structure it determines whether Google understands your page as a scattered collection of text or as an authoritative, well-organised resource. Structure it correctly, and you give Google every signal it needs to rank you high.
4.1 — The H1 Tag: Your Page's Single Headline
The <h1> is the most important heading on the page. There must be exactly one H1 per page — no more, no less.
Rules for the H1:
- Contains the primary keyword (ideally near the start)
- Describes what the entire page is about in a single clear sentence
- Is unique across the entire website — no two pages share an H1
- Is NOT the same as the title tag (it can be similar, but not identical)
- Appears before any other content on the page
<!-- BAD: Missing keyword, vague -->
<h1>Welcome to My Website</h1>
<!-- BAD: Keyword stuffed, unreadable -->
<h1>SEO SEO On-Page SEO SEO Guide SEO 2026 SEO Tutorial SEO</h1>
<!-- BAD: Two H1 tags on one page — breaks heading hierarchy -->
<h1>On-Page SEO Guide</h1>
...content...
<h1>Learn SEO Today</h1>
<!-- GOOD: Keyword-rich, natural, descriptive -->
<h1>Complete On-Page SEO Guide 2026: Step-by-Step for Beginners to Advanced</h1>
Why only one H1? Google treats the H1 as a signal for what the entire page is about. Multiple H1s create ambiguity — Google cannot determine which one represents the page's main topic.
4.2 — H2 to H6: Heading Hierarchy and Topic Sections
After the H1, you use H2 to H6 tags to create a logical hierarchy of sections and sub-sections. Think of it like a book's table of contents.
<h1>Complete On-Page SEO Guide 2026</h1> <!-- PAGE TOPIC: appears once -->
<h2>Step 1: Keyword Research</h2> <!-- MAJOR SECTION: use 3-8 H2s per page -->
<h3>Short-Tail vs Long-Tail Keywords</h3> <!-- SUB-SECTION under H2 -->
<h3>How to Find Keywords for Free</h3> <!-- another sub-section -->
<h4>Using Google Keyword Planner</h4> <!-- nested detail under H3 -->
<h4>Using Ahrefs Free Tools</h4> <!-- nested detail under H3 -->
<h2>Step 2: Writing SEO Content</h2> <!-- next major section -->
<h3>Content Structure Best Practices</h3>
<h3>Writing for E-E-A-T</h3>
<h2>Step 3: On-Page Head Tags</h2>
<h2>Step 4: On-Page Body Tags</h2>
SEO value of H2–H6 tags:
- H2 headings are the second most important signal after H1. Include your primary keyword or a closely related LSI keyword in at least 2–3 of your H2s
- H3–H6 headings help Google understand sub-topics and related concepts within the page
- Screen readers and accessibility tools use the heading hierarchy to help visually impaired users navigate pages — a well-structured page is both accessible and SEO-optimised
Critical mistake to avoid: Do not use heading tags for visual styling. Never write <h3> just because you want bold text. Use CSS classes for styling. Use headings only to mark semantic sections.
<!-- WRONG: Using H3 for visual styling only -->
<h3 class="section-label">Services</h3>
<p>We offer SEO, web development...</p>
<h3 class="section-label">Pricing</h3>
<!-- RIGHT: Using a styled span for decorative labels, H2 for actual section -->
<span class="section-tag">Our Services</span>
<h2>Digital Marketing & IT Services in Islamabad</h2>
<p>We offer SEO, web development...</p>
4.3 — Paragraph Content: Keyword Placement and Readability
The body text is where you prove your expertise and where keyword placement directly influences ranking.
Keyword placement rules in body paragraphs:
<!-- PRIMARY KEYWORD — should appear in the first 100 words of the page -->
<p>
<strong>On-page SEO</strong> is the practice of optimising individual web pages
so that search engines understand what the page is about and rank it for the
right search queries. Unlike off-page SEO, which involves backlinks and external
signals, on-page SEO is entirely within your control.
</p>
<!-- LSI KEYWORDS — woven naturally throughout the body -->
<p>
Effective on-page SEO combines proper use of <strong>title tags</strong>,
<strong>meta descriptions</strong>, heading structure, <strong>image alt text</strong>,
<strong>internal linking</strong>, and <strong>structured data markup</strong> —
each element sends a different signal to Google about your page's relevance and quality.
</p>
<!-- AVOID: Keyword stuffing -->
<p>
On-page SEO is important for SEO. On-page SEO helps with SEO.
Do on-page SEO for better SEO results with on-page SEO techniques.
</p>
<!-- This reads as spam to both users and Google. Keyword density
above 3% hurts rankings. Target 1–2%. -->
Readability signals Google measures:
- Short paragraphs: 2–4 sentences max. Long walls of text increase bounce rate.
- Short sentences: Average sentence length under 20 words
- Formatting variety: Mix paragraphs with bullet lists, numbered lists, blockquotes, and tables
- Bold and italic: Use
<strong>for important terms (semantic weight),<em>for emphasis. Not just for decoration.
<!-- Good use of semantic formatting -->
<p>
There are two critical rules for the title tag:
</p>
<ul>
<li><strong>Length:</strong> Keep it under 60 characters to avoid truncation in search results</li>
<li><strong>Keyword position:</strong> Place the primary keyword as early as possible in the title</li>
</ul>
4.4 — Image Optimisation: Alt Text, File Names, and Format
Images are invisible to Google's text crawler. Without proper optimisation, every image on your page is a missed SEO opportunity. Correct image optimisation also makes your site accessible to visually impaired users.
The 4 elements of SEO-optimised images:
Element 1: The alt Attribute (Most Important)
The alt attribute describes the image for search engines and screen readers. It is the primary way Google understands what an image shows.
<!-- BAD: Empty alt (image is invisible to Google) -->
<img src="seo-chart.png" alt="" />
<!-- BAD: Unhelpful alt (generic, no keywords) -->
<img src="seo-chart.png" alt="image" />
<img src="seo-chart.png" alt="photo" />
<img src="seo-chart.png" alt="screenshot" />
<!-- BAD: Keyword stuffed alt -->
<img src="seo.png" alt="SEO on-page SEO SEO tips SEO guide SEO Pakistan SEO 2026" />
<!-- GOOD: Descriptive, includes natural keyword, explains what the image shows -->
<img src="on-page-seo-keyword-research-process.png"
alt="On-page SEO keyword research process showing search volume and keyword difficulty chart" />
<img src="muhammad-shams-paracha.jpg"
alt="Muhammad Shams Paracha — IT Expert and Full Stack Developer in Islamabad, Pakistan" />
<img src="google-search-console-ranking.png"
alt="Google Search Console showing keyword ranking improvements after on-page SEO optimisation" />
Rule of thumb for alt text: Write it as if you are describing the image to someone who cannot see the screen. Be specific. Include a keyword only if it naturally fits the description — never force it.
Element 2: File Name
Before uploading an image, name the file descriptively using hyphens (not spaces or underscores).
BAD file names:
IMG_20240301_142533.jpg
screenshot1.png
photo.jpg
final_v2_REAL.png
GOOD file names:
on-page-seo-keyword-research-2026.png
google-keyword-planner-search-volume-screenshot.jpg
muhammad-shams-paracha-islamabad-it-expert.jpg
h1-tag-heading-hierarchy-example.png
Google reads the file name as an additional content signal. A file named on-page-seo-checklist.png adds context that a file named img1.png does not.
Element 3: Image Dimensions and the sizes attribute
For responsive images, use the sizes attribute to tell the browser which image size to load on different screen sizes. This reduces page load time, which improves Core Web Vitals.
<!-- Basic responsive image with srcset -->
<img
src="/images/on-page-seo-guide-800w.jpg"
srcset="
/images/on-page-seo-guide-400w.jpg 400w,
/images/on-page-seo-guide-800w.jpg 800w,
/images/on-page-seo-guide-1200w.jpg 1200w
"
sizes="(max-width: 640px) 400px, (max-width: 1024px) 800px, 1200px"
alt="Complete on-page SEO guide diagram showing keyword-to-content-to-ranking flow"
width="1200"
height="630"
loading="lazy"
/>
Element 4: Loading Strategy
Use loading="lazy" on all images below the fold (images the user does not see immediately on page load). This defers loading of off-screen images, dramatically improving initial page load time.
Use loading="eager" (the default) or fetchpriority="high" on your hero image — the first large image the user sees. Slow hero images are the #1 cause of poor LCP scores.
<!-- Hero image — load immediately -->
<img src="/hero.jpg" alt="Muhammad Shams Paracha IT Expert Portfolio" loading="eager" fetchpriority="high" />
<!-- Below-fold images — load when user scrolls near them -->
<img src="/services-diagram.jpg" alt="IT services overview diagram" loading="lazy" />
<img src="/client-review.jpg" alt="Client review screenshot" loading="lazy" />
Next.js / React — Using the Image Component
If you use Next.js, never use a plain <img> tag. The <Image> component from next/image handles all optimisation automatically:
import Image from 'next/image'
// Correct usage — Next.js Image component
<Image
src="/on-page-seo-guide-cover.jpg"
alt="Complete on-page SEO guide 2026 — step by step tutorial for beginners"
width={1200}
height={630}
priority={false} // true = eager load (use for hero images only)
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 80vw, 1200px"
className="rounded-2xl w-full h-auto"
/>
Next.js Image automatically: serves WebP/AVIF format (30–50% smaller than JPEG), generates responsive srcsets, applies lazy loading by default, prevents layout shift by reserving space.
4.5 — Internal Linking: The Most Underused On-Page Signal
Internal links are links from one page on your website to another page on the same website. They do three critical things for SEO:
- Transfer ranking authority (PageRank) from high-authority pages to newer/weaker pages
- Help Google discover and index new pages by following links from already-indexed pages
- Signal topical relevance — linking from an SEO guide to a keyword research article tells Google both pages are part of the same topic cluster
The anatomy of a well-optimised internal link:
<!-- BAD: Generic anchor text tells Google nothing about the destination -->
<a href="/blog/keyword-research">Click here</a>
<a href="/services">Read more</a>
<a href="/about">Learn more</a>
<!-- BAD: Anchor text is the page title — okay, but not optimised -->
<a href="/blog/keyword-research">Keyword Research Guide</a>
<!-- GOOD: Descriptive anchor text matches what the destination page is about -->
<a href="/blog/keyword-research">
free keyword research tools for beginners in 2026
</a>
<a href="/services">
digital marketing and SEO services in Islamabad
</a>
<a href="/projects">
SaaS and web development projects portfolio
</a>
The anchor text rule: The text you put inside <a>...</a> is what Google uses to understand what the destination page is about. Every internal link is a small vote that says: "This linked page is relevant to the phrase I used as anchor text."
Internal linking strategy for a new website:
Homepage ──links to──→ All category pages (About, Projects, Blog, Courses)
Blog post ──links to──→ Related blog posts (topical cluster)
Blog post ──links to──→ Relevant service page (funnel to conversion)
About ──links to──→ Contact / Services
Projects ──links to──→ Contact (conversion path)
Aim for 3–5 internal links per blog post — more than that on shorter pages can look spammy. Each internal link should be genuinely useful to the reader.
4.6 — URL Structure: Clean, Keyword-Rich, Readable
Your page URL is an SEO signal. Google reads it to understand the page topic. Users read it in search results to decide whether to click.
URL best practices:
BAD URLs (unclear, not keyword-optimised):
/page?id=1234
/blog/2024/03/15/post
/p/6789
/blog/blog_post_final_v2
/blog/Article_About_SEO_2026
GOOD URLs (descriptive, keyword-rich, clean):
/blog/complete-on-page-seo-guide-2026
/blog/keyword-research-for-beginners
/services/seo-digital-marketing-islamabad
/projects/medilab-pro-saas
Rules:
- Use hyphens (-) to separate words, NOT underscores (_)
- All lowercase letters
- Keep URLs under 60 characters when possible
- Include the primary keyword in the URL
- No stop words (a, the, is, for) unless needed for readability
- No session IDs, query parameters, or tracking codes in canonical URLs
4.7 — Featured Snippet Optimisation: Answer Boxes at Position Zero
Featured snippets are the answer boxes that appear above the standard search results in Google. They are sometimes called "Position Zero" because they rank higher than Position 1. Getting a featured snippet can increase your click-through rate by 20–30%.
Google pulls featured snippets from pages that answer a specific question clearly and concisely. You can target them by structuring your content to match the three featured snippet formats:
Format 1: Paragraph snippets (for "what is" and "how does" questions)
<!-- Target query: "what is on-page SEO" -->
<!-- Write a clear 40–60 word definition directly after the question/heading -->
<h2>What Is On-Page SEO?</h2>
<p>
<strong>On-page SEO</strong> is the process of optimising individual web pages
to rank higher in search engines and earn more qualified traffic. It includes
optimising the title tag, meta description, heading structure, content,
image alt text, URL, and internal links — all within the page itself.
</p>
Format 2: List snippets (for "how to" and "steps" questions)
<!-- Target query: "how to do on-page SEO step by step" -->
<h2>How to Do On-Page SEO Step by Step</h2>
<ol>
<li><strong>Research your primary keyword</strong> using Google Keyword Planner or Ahrefs</li>
<li><strong>Write an optimised title tag</strong> under 60 characters with the keyword near the start</li>
<li><strong>Write a compelling meta description</strong> under 160 characters</li>
<li><strong>Use one H1 tag</strong> that contains the primary keyword</li>
<li><strong>Structure H2–H3 headings</strong> to cover subtopics and LSI keywords</li>
<li><strong>Optimise all images</strong> with descriptive file names and alt text</li>
<li><strong>Add 3–5 internal links</strong> with descriptive anchor text</li>
<li><strong>Add structured data markup</strong> (JSON-LD) appropriate to page type</li>
</ol>
Format 3: Table snippets (for comparison questions)
<!-- Target query: "short tail vs long tail keywords comparison" -->
<h3>Short-Tail vs Long-Tail Keywords: Quick Comparison</h3>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Short-Tail</th>
<th>Long-Tail</th>
</tr>
</thead>
<tbody>
<tr><td>Word count</td> <td>1–2 words</td> <td>3–6+ words</td></tr>
<tr><td>Monthly searches</td> <td>10k–1M+</td> <td>50–2,000</td></tr>
<tr><td>Ranking difficulty</td> <td>Very hard</td> <td>Achievable</td></tr>
<tr><td>Conversion rate</td> <td>Low</td> <td>High</td></tr>
<tr><td>Best for</td> <td>Established sites</td><td>New & growing sites</td></tr>
</tbody>
</table>
4.8 — FAQ Schema: Own the "People Also Ask" Section
FAQ structured data tells Google that your page contains questions and answers. Google can display these as an expandable dropdown directly in the search results — taking up significantly more SERP space and improving click-through rate.
<!-- Add this JSON-LD schema anywhere in your page body or head -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is the most important on-page SEO element?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The title tag is the single most important on-page SEO element. It tells search engines and users what the page is about, appears as the clickable headline in search results, and should include the primary keyword within the first 60 characters."
}
},
{
"@type": "Question",
"name": "How many H1 tags should a page have?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Every page should have exactly one H1 tag. The H1 is the page's main heading and tells Google what the entire page is about. Multiple H1 tags create ambiguity and dilute the SEO signal."
}
},
{
"@type": "Question",
"name": "What is the ideal meta description length for 2026?",
"acceptedAnswer": {
"@type": "Answer",
"text": "The ideal meta description length in 2026 is between 140 and 160 characters. Descriptions longer than 160 characters are truncated by Google in search results, cutting off your message."
}
}
]
}
</script>
Requirement: The FAQ questions and answers in the schema MUST also appear visibly on the page. Google does not accept hidden FAQ schema.
Step 5: Core Web Vitals — The SEO Performance Signals
Core Web Vitals are Google's three key measurements of page performance. Since May 2021, they are official ranking factors. A page that loads slowly, jumps around visually, or responds sluggishly will rank lower than a fast, stable competitor — even if the content quality is identical.
LCP — Largest Contentful Paint (Target: under 2.5 seconds)
LCP measures how long it takes for the largest visible element (usually the hero image or main heading) to load. A slow LCP is almost always caused by unoptimised images.
How to improve LCP:
- Use
fetchpriority="high"orpriorityon the hero image - Serve images in WebP or AVIF format (use Next.js Image component)
- Preconnect to image CDNs in the
<head> - Remove render-blocking resources (large CSS/JS in the head)
CLS — Cumulative Layout Shift (Target: under 0.1)
CLS measures how much the page "jumps around" visually as it loads. When an image or ad loads and pushes the text you were reading down the page, that is layout shift.
How to prevent CLS:
- Always set explicit
widthandheightattributes on images — this reserves space before the image loads - Avoid inserting content above existing content after load (like cookie banners that push content down)
- Ensure web fonts do not cause text to reflow (
font-display: swapin CSS)
FID / INP — Interaction to Next Paint (Target: under 200ms)
Measures how fast the page responds when a user clicks a button or taps a link.
How to improve INP:
- Minimise JavaScript execution time
- Defer non-critical JavaScript with
asyncanddefer - Use React/Next.js code splitting to load only needed JavaScript per page
Complete On-Page SEO Checklist for 2026
Use this checklist before publishing any page:
Keyword & Intent
- One primary keyword selected (3+ words, KD < 30 for new sites)
- Keyword intent confirmed — page type matches intent
- 3–5 LSI keywords identified
Head Tags
- Title tag: 50–60 chars, primary keyword near the start, unique
- Meta description: 140–160 chars, includes keyword, compelling CTA
- Canonical URL set to the correct clean URL
- Open Graph tags: og:title, og:description, og:image (1200×630px), og:url
- Twitter Card tags set
- JSON-LD schema added (Article, FAQPage, or appropriate type)
- Viewport meta tag present
Body Structure
- Exactly one H1 tag, contains primary keyword
- H2 headings cover major sections, include LSI keywords naturally
- H3–H4 used for sub-sections (never for styling only)
- Primary keyword appears in first 100 words
- Keyword density: 1–2% (not stuffed)
- Short paragraphs: 2–4 sentences each
Images
- All images have descriptive alt text (not empty, not "image")
- File names are descriptive and hyphen-separated
- Hero image uses eager loading / fetchpriority="high"
- All below-fold images use loading="lazy"
- Images served in modern format (WebP/AVIF)
- width and height attributes set on all images
Links
- 3–5 internal links with descriptive anchor text
- External links to authoritative sources (open in new tab with rel="noopener")
- No broken links
Technical
- URL is clean, lowercase, hyphen-separated, includes keyword
- Page loads in under 2.5 seconds (test with PageSpeed Insights)
- LCP < 2.5s, CLS < 0.1, INP < 200ms
- Page is fully mobile-responsive
Conclusion: On-Page SEO Is a System, Not a Checklist
The difference between a page that ranks on page 1 and a page that ranks on page 5 is rarely one big thing. It is the accumulation of every small on-page signal done correctly: a precise title tag, a matching meta description, a single clear H1, images with meaningful alt text, internal links with descriptive anchors, structured data that helps Google categorise the page, and content that genuinely serves the searcher's intent.
None of these elements are difficult on their own. The challenge is doing all of them consistently, on every page you publish.
Start with keyword research. Get the intent right. Then build each page from <head> to </body> with every signal in place. Repeat that process, and in 6–12 months, you will have a website that Google trusts and rewards with consistent organic traffic.
If you want help auditing your website's on-page SEO or building a keyword strategy, reach out directly — I work with businesses of all sizes to implement exactly the strategies covered in this guide.