Ready-to-copy meta tags, JSON-LD schema, robots.txt rules, .htaccess snippets, and essential search optimization patterns – all in one place.
Essential HTML head elements: title tags, meta descriptions, Open Graph, Twitter Cards, canonical URLs, and hreflang attributes.
The core meta tags every webpage needs for SEO – title, description, viewport, and charset.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Your Page Title (50-60 chars)</title> <meta name="description" content="Compelling meta description under 160 characters that includes your primary keyword naturally."> <link rel="canonical" href="https://example.com/page-url/"> </head>
Control how your content appears when shared on Facebook, LinkedIn, and other social platforms.
<meta property="og:title" content="Your Page Title"> <meta property="og:description" content="Description for social sharing."> <meta property="og:image" content="https://example.com/og-image.jpg"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="630"> <meta property="og:url" content="https://example.com/page-url/"> <meta property="og:type" content="website"> <meta property="og:site_name" content="Your Site Name"> <meta property="og:locale" content="en_US">
Optimize how your links render on Twitter/X with summary cards and large image cards.
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:title" content="Your Page Title"> <meta name="twitter:description" content="Twitter-specific description under 200 chars."> <meta name="twitter:image" content="https://example.com/twitter-image.jpg"> <meta name="twitter:image:alt" content="Descriptive alt text for the image"> <meta name="twitter:site" content="@yourhandle"> <meta name="twitter:creator" content="@authorhandle">
Tell search engines which language and regional version of a page to serve to users.
<link rel="alternate" hreflang="en" href="https://example.com/en/page"> <link rel="alternate" hreflang="en-US" href="https://example.com/en-us/page"> <link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/page"> <link rel="alternate" hreflang="es" href="https://example.com/es/page"> <link rel="alternate" hreflang="fr" href="https://example.com/fr/page"> <link rel="alternate" hreflang="x-default" href="https://example.com/">
Control how search engines index and follow links on individual pages.
<!-- Allow indexing and following links --> <meta name="robots" content="index, follow"> <!-- Prevent indexing but allow link following --> <meta name="robots" content="noindex, follow"> <!-- Prevent indexing and link following --> <meta name="robots" content="noindex, nofollow"> <!-- For Google specifically --> <meta name="googlebot" content="noindex, nofollow">
Complete favicon and Apple touch icon setup for all devices and browsers.
<link rel="icon" type="image/svg+xml" href="/favicon.svg"> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="manifest" href="/site.webmanifest"> <meta name="theme-color" content="#0D9488">
JSON-LD structured data markup for rich results – articles, products, FAQs, breadcrumbs, and organization schemas.
JSON-LD markup for blog posts and news articles to enable rich results in search.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Your Article Title",
"description": "Article description.",
"image": "https://example.com/image.jpg",
"author": {
"@type": "Person",
"name": "Author Name"
},
"datePublished": "2024-01-15",
"dateModified": "2024-06-20",
"publisher": {
"@type": "Organization",
"name": "Your Site Name"
}
}
</script>E-commerce product markup with price, availability, and aggregate rating for rich snippets.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Product Name",
"description": "Product description.",
"image": "https://example.com/product.jpg",
"sku": "ABC-12345",
"offers": {
"@type": "Offer",
"price": "29.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"priceValidUntil": "2024-12-31"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"reviewCount": "128"
}
}
</script>Mark up FAQ content to appear as expandable rich results directly in Google search.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{
"@type": "Question",
"name": "What is SEO?",
"acceptedAnswer": {
"@type": "Answer",
"text": "SEO stands for Search Engine Optimization..."
}
}, {
"@type": "Question",
"name": "How long does SEO take?",
"acceptedAnswer": {
"@type": "Answer",
"text": "SEO typically takes 3-6 months..."
}
}]
}
</script>Enable breadcrumb rich results in search with proper structured data markup.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://example.com/"
}, {
"@type": "ListItem",
"position": 2,
"name": "Category",
"item": "https://example.com/category/"
}, {
"@type": "ListItem",
"position": 3,
"name": "Current Page"
}]
}
</script>Establish your brand entity with organization markup including logo and social profiles.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Your Company Name",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"description": "Company description.",
"sameAs": [
"https://facebook.com/yourpage",
"https://twitter.com/yourhandle",
"https://linkedin.com/company/yourcompany"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-123-4567",
"contactType": "customer service"
}
}
</script>.htaccess redirects, caching configurations, SSL setups, performance headers, and core web vitals optimization.
Apache .htaccess rules for permanent 301 redirects – essential for site migrations and URL changes.
# Redirect single page
Redirect 301 /old-page.html https://example.com/new-page/
# Redirect entire directory
RedirectMatch 301 ^/old-directory/(.*)$ /new-directory/$1
# RewriteEngine redirects (more flexible)
RewriteEngine On
RewriteCond %{HTTP_HOST} ^old-domain\.com$ [NC]
RewriteRule ^(.*)$ https://new-domain.com/$1 [L,R=301]
# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]Configure browser and server caching for faster page loads and better Core Web Vitals.
# .htaccess caching rules <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/webp "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType text/javascript "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" ExpiresByType text/html "access plus 1 hour" </IfModule> # Cache-Control headers <FilesMatch "\.(jpg|jpeg|png|gif|webp|svg)$"> Header set Cache-Control "max-age=31536000, public, immutable" </FilesMatch>
Enable text compression to reduce page size and improve load times for all users.
# GZIP compression via .htaccess <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml AddOutputFilterByType DEFLATE text/css text/javascript AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE application/json AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/x-font-ttf </IfModule> # Brotli (if supported by server) <IfModule mod_brotli.c> AddOutputFilterByType BROTLI_COMPRESS text/html text/css AddOutputFilterByType BROTLI_COMPRESS text/javascript </IfModule>
Ensure all traffic uses HTTPS with proper redirect rules and security headers.
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
# HSTS header (HTTP Strict Transport Security)
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Prevent mixed content
Header always set Content-Security-Policy "upgrade-insecure-requests"
# Security headers
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "DENY"
Header set X-XSS-Protection "1; mode=block"Quick reference for improving LCP, INP, and CLS – the three Core Web Vitals metrics.
# LCP (Largest Contentful Paint) – target < 2.5s ✓ Preload hero image: <link rel="preload" as="image" href="hero.webp"> ✓ Use responsive images with srcset ✓ Enable lazy loading for below-fold images ✓ Use a CDN for static assets # INP (Interaction to Next Paint) – target < 200ms ✓ Minimize JavaScript execution time ✓ Use requestAnimationFrame for animations ✓ Defer non-critical JS: <script defer src="..."> # CLS (Cumulative Layout Shift) – target < 0.1 ✓ Set explicit width & height on images ✓ Reserve space for embeds & iframes ✓ Avoid inserting content above existing content
Optimize images for search with proper alt text, responsive markup, and modern formats.
<!-- Responsive image with WebP fallback -->
<picture>
<source srcset="image.webp" type="image/webp">
<source srcset="image.jpg" type="image/jpeg">
<img src="image.jpg"
alt="Descriptive keyword-rich alt text"
width="800" height="600"
loading="lazy"
decoding="async">
</picture>
<!-- srcset for responsive images -->
<img src="image-800w.jpg"
srcset="image-400w.jpg 400w, image-800w.jpg 800w, image-1200w.jpg 1200w"
sizes="(max-width: 600px) 400px, (max-width: 1200px) 800px, 1200px"
alt="Descriptive alt text">Header hierarchy, internal linking strategies, URL structure best practices, and content optimization techniques.
Proper heading structure for SEO – one H1 per page with logical H2-H6 nesting.
<!-- One H1 per page – matches the page title --> <h1>Complete Guide to On-Page SEO</h1> <!-- H2 for main sections --> <h2>What is On-Page SEO?</h2> <p>On-page SEO refers to...</p> <h2>Key On-Page SEO Elements</h2> <!-- H3 for subsections --> <h3>Title Tags</h3> <p>Title tags are...</p> <h3>Meta Descriptions</h3> <p>Meta descriptions should...</p> <!-- H4 for deeper nesting when needed --> <h4>Optimal Meta Description Length</h4>
Best practices for internal link anchor text, link placement, and site architecture.
<!-- Descriptive, keyword-rich anchor text --> <a href="/on-page-seo-guide/">Learn more about on-page SEO techniques</a> <!-- Contextual internal link within body content --> <p>For better rankings, implement our <a href="/technical-seo-checklist/">technical SEO checklist</a> alongside your content strategy.</p> <!-- Breadcrumb navigation – good for SEO --> <nav aria-label="Breadcrumb"> <a href="/">Home</a> › <a href="/seo/">SEO Guides</a> › <span>On-Page SEO</span> </nav> <!-- Related content section --> <aside> <h3>Related Articles</h3> <a href="/keyword-research/">Keyword Research Guide</a> <a href="/link-building/">Link Building Strategies</a> </aside>
Create clean, keyword-rich URLs that search engines and users can easily understand.
# Good URL structure examples: ✅ https://example.com/seo/on-page-guide/ ✅ https://example.com/blog/what-is-technical-seo/ ✅ https://example.com/products/blue-widget/ ✅ https://example.com/category/subcategory/ # Bad URL structure – avoid: ❌ https://example.com/?p=123 ❌ https://example.com/page.php?id=456&cat=seo ❌ https://example.com/2024/01/15/article-title/ ❌ https://example.com/this-is-a-very-long-url-that-goes-on-forever/ # URL best practices: ✓ Use lowercase letters ✓ Separate words with hyphens (not underscores) ✓ Keep URLs short and descriptive ✓ Include target keywords naturally ✓ Avoid stop words (the, and, of, etc.)
Proven title tag formulas that drive clicks while maintaining keyword relevance.
# Title tag formulas (50-60 characters): # How-to / Guide How to [Topic] – Complete Guide [Year] # List post [Number] Best [Topic] for [Purpose] ([Year]) # Review / Comparison [Product] Review: Pros, Cons & Verdict # Question-based What Is [Topic]? A Beginner's Guide # Urgency / Timeliness [Topic] Tips You Need to Know in [Year] # Example implementations: <title>How to Do Keyword Research – Complete Guide 2024</title> <title>12 Best SEO Tools for Beginners (Free & Paid)</title>
Compelling meta description templates that improve click-through rates from search results.
# Meta description formulas (under 160 chars): # Benefit-driven Learn how to [achieve result] with our [type of content]. Discover [key benefit #1], [key benefit #2], and more. # Question + answer Wondering how to [topic]? We cover everything from [subtopic A] to [subtopic B]. Read our complete guide. # Urgency / scarcity Don't miss these [number] [topic] tips that can [benefit]. Updated for [year] with new strategies. # Social proof Join [number]+ [professionals] who use our [topic] strategies. Get proven tips, examples, and templates. # Example: <meta name="description" content="Master keyword research with our step-by-step guide. Learn how to find low-competition keywords, analyze search intent, and rank higher. Updated for 2024.">
Configure robots.txt files, XML sitemaps, and crawl directives to control how search engines access your site.
A well-configured robots.txt file to guide search engine crawlers on what to index.
User-agent: * Allow: / Disallow: /wp-admin/ Disallow: /private/ Disallow: /tmp/ Disallow: /*?* # Block URLs with query parameters # Crawl delay (use sparingly) Crawl-delay: 10 # Sitemap location Sitemap: https://example.com/sitemap.xml Sitemap: https://example.com/sitemap-images.xml # Specific rules for Googlebot User-agent: Googlebot Allow: / Disallow: /search/ # Block specific bots User-agent: BadBot Disallow: /
Standard XML sitemap format with priority, change frequency, and last modification date.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>https://example.com/</loc>
<lastmod>2024-06-15</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/blog/</loc>
<lastmod>2024-06-14</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>Manage multiple sitemaps with a sitemap index – ideal for large websites with 50,000+ URLs.
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2024-06-15</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2024-06-14</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2024-06-13</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-images.xml</loc>
<lastmod>2024-06-12</lastmod>
</sitemap>
</sitemapindex>Strategies to optimize crawl budget for large sites – reduce wasted crawl on low-value pages.
# Crawl budget optimization checklist: ✓ Block low-value pages in robots.txt: Disallow: /tag/ Disallow: /search/ Disallow: /filter/ Disallow: /sort/ ✓ Use noindex for thin content pages <meta name="robots" content="noindex"> ✓ Remove duplicate content ✓ Fix redirect chains (keep to < 3 hops) ✓ Eliminate soft 404s ✓ Use canonical tags consistently ✓ Keep sitemaps clean & up-to-date ✓ Monitor in Google Search Console → Settings → Crawl stats ✓ Improve server response time ✓ Implement proper 304 Not Modified responses ✓ Use If-Modified-Since headers
Content optimization frameworks, E-E-A-T guidelines, keyword placement strategies, and content structure templates.
Google's E-E-A-T framework – Experience, Expertise, Authoritativeness, and Trustworthiness for content quality.
# E-E-A-T Content Checklist: ## Experience (new – Dec 2022) ✓ Demonstrate first-hand experience with the topic ✓ Include original photos, case studies, or data ✓ Share personal insights and unique perspectives ## Expertise ✓ Show author credentials and qualifications ✓ Cite reputable sources and studies ✓ Use accurate, well-researched information ✓ Include author bio with relevant background ## Authoritativeness ✓ Build quality backlinks from authoritative sites ✓ Get mentioned in industry publications ✓ Maintain active, credible social presence ## Trustworthiness ✓ Keep content accurate and up-to-date ✓ Display clear contact information ✓ Use HTTPS and secure payment methods ✓ Include privacy policy and terms pages
Strategic locations to place your target keywords for maximum SEO impact on any page.
# Where to place target keywords: ✅ Page title (closer to the front = better) ✅ H1 heading (should match title closely) ✅ First 100 words of content ✅ H2 and H3 subheadings (naturally) ✅ Meta description (appears in search snippet) ✅ URL slug (short, keyword-rich) ✅ Image alt text (descriptive, not stuffed) ✅ Image file names (use hyphens) ✅ Internal link anchor text ✅ Last 100 words of content # What to avoid: ❌ Keyword stuffing ❌ Exact match repetition ❌ Hidden text or links ❌ Irrelevant keyword insertion # Optimal keyword density: 1-2% naturally
A proven blog post structure template that ranks well and keeps readers engaged.
# High-Ranking Blog Post Structure: ## 1. Compelling Title (H1) Include primary keyword + hook ## 2. Introduction (100-150 words) - Hook the reader - State the problem - Preview the solution - Include primary keyword ## 3. Table of Contents (optional) - Jump links for long posts ## 4. Main Body (H2 sections) - Cover subtopics thoroughly - Use examples and data - Include images and visuals - Internal links to related content ## 5. Key Takeaways / Summary - Bullet points of main points ## 6. FAQ Section (H2) - Answer common questions - Add FAQ schema ## 7. Call to Action (CTA) - What should the reader do next?
Understand the four types of search intent and how to match your content to each one.
# 4 Types of Search Intent:
## 1. Informational ("what is...", "how to...")
Content: Guides, tutorials, explainers, definitions
Format: Blog posts, videos, infographics
Example: "how does SEO work"
## 2. Navigational (brand or site name)
Content: Homepage, about page, landing pages
Format: Clear site structure, branded content
Example: "semrush login"
## 3. Commercial ("best...", "vs...", "review")
Content: Comparisons, reviews, buyer's guides
Format: List posts, comparison tables
Example: "best seo tools 2024"
## 4. Transactional ("buy...", "price...", "discount")
Content: Product pages, pricing, deals
Format: E-commerce pages, landing pages
Example: "buy seo course online"Systematic approach to updating old content for better rankings and sustained traffic growth.
# Content Refresh Checklist: ✓ Update outdated statistics and data ✓ Add new sections covering recent developments ✓ Improve readability (shorter paragraphs) ✓ Add or update images and visuals ✓ Fix broken links and add new internal links ✓ Update the publish date to current year ✓ Expand thin sections with more detail ✓ Add FAQ section with schema markup ✓ Improve meta title and description ✓ Check and update keyword targeting ✓ Add table of contents for long posts ✓ Merge similar short posts into one guide ✓ Remove or consolidate low-performing content # When to refresh: - Posts older than 12-18 months - Pages with declining traffic - Content about fast-changing topics
Google Business Profile optimization, local schema markup, NAP consistency, and local citation strategies.
JSON-LD markup for local businesses with address, hours, geo-coordinates, and contact details.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Your Business Name",
"description": "Business description.",
"image": "https://example.com/storefront.jpg",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "Cityville",
"addressRegion": "CA",
"postalCode": "90210",
"addressCountry": "US"
},
"geo": {
"@type": "GeoCoordinates",
"latitude": 34.0522,
"longitude": -118.2437
},
"telephone": "+1-555-123-4567",
"openingHoursSpecification": [{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Mon","Tue","Wed","Thu","Fri"],
"opens": "09:00",
"closes": "17:00"
}],
"priceRange": "$$"
}
</script>Key optimization tips for ranking higher in Google Maps and local pack results.
# Google Business Profile Optimization: ✓ Claim and verify your profile ✓ Use your exact business name (no keyword stuffing) ✓ Select accurate primary and secondary categories ✓ Add complete address (or service area) ✓ Add phone number (consistent with website) ✓ Set accurate business hours (including holidays) ✓ Write a compelling business description (750 chars) ✓ Add high-quality photos and videos regularly ✓ Enable messaging for customer inquiries ✓ Respond to all reviews (positive and negative) ✓ Post weekly updates, offers, and events ✓ Add products and services with descriptions ✓ Use Google Posts for promotions ✓ Enable and monitor Q&A section ✓ Track insights and adjust strategy # Pro tip: Get reviews on a consistent schedule – aim for 2-5 new reviews per week
Ensure your Name, Address, and Phone number are identical across all online directories and citations.
# NAP Consistency Guidelines: ## Name ✅ "Acme Plumbing Services" ❌ "Acme Plumbing Services Inc." ❌ "Acme Plumbing" → Pick ONE version and use it everywhere ## Address ✅ "123 Main Street, Suite 4B, Cityville, CA 90210" ❌ "123 Main St, Ste 4B, Cityville, California 90210" → Use the exact same format (Street vs St) ## Phone ✅ "(555) 123-4567" ❌ "555-123-4567" ❌ "+1 555 123 4567" → Choose one format and stick with it # Key citation sources: ✓ Google Business Profile ✓ Yelp ✓ Facebook ✓ Apple Maps ✓ Bing Places ✓ Better Business Bureau ✓ Industry-specific directories
Create effective city or location landing pages for multi-location businesses.
# Local Landing Page Checklist: ✓ Unique title: "[Service] in [City] | [Company]" ✓ H1: "[Service] in [City, State]" ✓ Unique content for each location page ✓ Embed Google Map with location pin ✓ Local business schema for each location ✓ Real customer reviews from that location ✓ Location-specific photos (not stock) ✓ Local phone number and address ✓ Driving directions or landmarks ✓ List of nearby cities served ✓ Local testimonials and case studies ✓ FAQ specific to the area ✓ Internal links to other location pages # What to avoid: ❌ Duplicate content across location pages ❌ Just changing the city name ❌ No actual presence at the location ❌ Keyword stuffing city names
GA4 setup, Google Tag Manager configurations, UTM parameter templates, and conversion tracking snippets.
Google Analytics 4 (GA4) tracking code installation for web property measurement.
<!-- Google Analytics 4 (GA4) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
<!-- Event tracking example -->
<script>
// Track button clicks
document.querySelector('#cta-button').addEventListener('click', function() {
gtag('event', 'click', {
'event_category': 'engagement',
'event_label': 'CTA Button',
'value': 1
});
});
</script>GTM container installation code for head and body – manage all tracking tags in one place.
<!-- Google Tag Manager (head) -->
<script>
(function(w,d,s,l,i){
w[l]=w[l]||[];
w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';
j.async=true;
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');
</script>
<!-- Google Tag Manager (body – noscript fallback) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>Standard UTM parameter formats for tracking marketing campaigns across all channels.
# UTM Parameter Structure: ?utm_source=___&utm_medium=___&utm_campaign=___&utm_content=___&utm_term=___ # Email newsletter: ?utm_source=newsletter&utm_medium=email&utm_campaign=spring_sale_2024 # Social media post: ?utm_source=facebook&utm_medium=social&utm_campaign=product_launch&utm_content=carousel_ad_1 # Paid search ad: ?utm_source=google&utm_medium=cpc&utm_campaign=brand_search&utm_term=seo+tools # Referral / partner: ?utm_source=partnerblog&utm_medium=referral&utm_campaign=guest_post_q2 # Display / banner ad: ?utm_source=google&utm_medium=display&utm_campaign=retargeting&utm_content=banner_728x90 # Pro tip: Use lowercase, avoid spaces, # and be consistent with naming conventions!
Set up conversion tracking for Google Ads, Facebook Pixel, and custom event goals.
<!-- Facebook Pixel -->
<script>
!function(f,b,e,v,n,t,s){
if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window,document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>
<!-- Google Ads Conversion -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-XXXXXXXX/XXXXXXXX',
'value': 1.0,
'currency': 'USD',
'transaction_id': ''
});
</script>Verify site ownership in Google Search Console using HTML tag, DNS record, or file upload.
# Method 1: HTML meta tag (easiest) <meta name="google-site-verification" content="YOUR_VERIFICATION_CODE"> # Method 2: DNS TXT record # Add to your DNS configuration: # Type: TXT # Host: @ (or your domain) # Value: google-site-verification=YOUR_VERIFICATION_CODE # Method 3: HTML file upload # Download the HTML file from Search Console # Upload to: https://example.com/googleXXXXXXX.html # Method 4: Google Analytics # Use your existing GA4 tracking code # Method 5: Google Tag Manager # Use your existing GTM container # Pro tip: Verify at the domain property level # to cover all subdomains and protocols
JavaScript SEO, log file analysis patterns, international SEO, entity-based SEO, and programmatic SEO techniques.
Ensure JavaScript-rendered content is crawlable and indexable by search engines.
# JavaScript SEO Best Practices: ✓ Use Server-Side Rendering (SSR) or Static Generation ✓ Implement dynamic rendering for bots if needed ✓ Use <noscript> fallbacks for critical content ✓ Ensure internal links use <a href> (not onclick) ✓ Avoid hash-based routing (#) – use History API ✓ Test with Google's Mobile-Friendly Test tool ✓ Use structured data even in JS-rendered content ✓ Lazy-load content responsibly (avoid CLS) ✓ Monitor in Search Console for rendering issues # Framework-specific: ✓ Next.js: Use getServerSideProps or generateStaticParams ✓ React: Consider React Helmet for meta tags ✓ Vue: Use Vue Meta for head management # Rendering strategies: ✓ CSR: Client-Side Rendering (risky for SEO) ✓ SSR: Server-Side Rendering (recommended) ✓ SSG: Static Site Generation (best for blogs) ✓ ISR: Incremental Static Regeneration (hybrid)
Common regex patterns and commands for analyzing server logs to understand crawl behavior.
# Common log analysis commands (Linux/Mac):
# Extract Googlebot requests
grep "Googlebot" access.log
# Count unique URLs crawled by Googlebot
grep "Googlebot" access.log | awk '{print $7}' | sort -u | wc -l
# Find most crawled URLs
grep "Googlebot" access.log | awk '{print $7}' | sort | uniq -c | sort -rn | head -20
# Count crawl frequency by hour
grep "Googlebot" access.log | awk '{print $4}' | cut -d: -f2 | sort | uniq -c
# Find 404 errors encountered by Googlebot
grep "Googlebot" access.log | grep ' 404 ' | awk '{print $7}' | sort -u
# Regex for Googlebot user agents
Googlebot|Googlebot-Image|Googlebot-News|Googlebot-Video|AdsBot-Google
# Monitor crawl budget waste
grep "Googlebot" access.log | grep -E ' (301|302|404|500) 'Complete international SEO approach covering domain strategy, hreflang, and geo-targeting.
# International SEO Decision Matrix: ## Domain Strategy Options: ✓ ccTLD: example.fr (strongest geo signal) ✓ Subdirectory: example.com/fr/ (easiest to manage) ✓ Subdomain: fr.example.com (middle ground) ✓ gTLD with geo-targeting in Search Console ## Hreflang Implementation: <link rel="alternate" hreflang="en-us" href="https://example.com/en-us/"> <link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/"> <link rel="alternate" hreflang="fr" href="https://example.com/fr/"> <link rel="alternate" hreflang="x-default" href="https://example.com/"> ## Key Considerations: ✓ Translate all content (don't just auto-translate) ✓ Adapt to local culture and customs ✓ Use local currency and measurements ✓ Host locally or use CDN for speed ✓ Build local backlinks for each market ✓ Register with local search engines (Baidu, Yandex, Naver)
Build scalable, template-driven pages for large-scale SEO – ideal for directories and marketplaces.
# Programmatic SEO Framework: ## 1. Identify Your Data Sources ✓ Internal databases ✓ Public datasets ✓ API integrations ✓ Web scraping (ethical & legal) ## 2. Design Your URL Pattern ✓ example.com/[category]/[city]/ ✓ example.com/compare/[product-a]-vs-[product-b]/ ✓ example.com/jobs/[role]/[location]/ ## 3. Create Page Templates ✓ Unique title and meta description per page ✓ Dynamic H1 with relevant keywords ✓ Unique content (avoid thin content penalties) ✓ Structured data markup ✓ Internal linking between related pages ✓ Breadcrumb navigation ## 4. Quality Safeguards ✓ Minimum content threshold per page ✓ Avoid duplicate content patterns ✓ Add user-generated content (reviews, ratings) ✓ Implement faceted navigation properly ✓ Monitor indexation in Search Console
Optimize for entities and the Knowledge Graph – the future of semantic search.
# Entity SEO Optimization: ## Build Entity Associations: ✓ Claim your Knowledge Graph panel ✓ Create a Wikipedia page (if notable) ✓ Maintain consistent Wikidata entries ✓ Get listed in DBpedia and Freebase ## On-Site Entity Signals: ✓ Use Organization schema with sameAs links ✓ Link to authoritative sources (outbound) ✓ Build topic clusters (not just keywords) ✓ Use natural language and related terms ✓ Implement clear site architecture ## Off-Site Entity Signals: ✓ Earn mentions on authoritative sites ✓ Get cited in industry publications ✓ Build co-citation relationships ✓ Maintain consistent NAP across the web ✓ Participate in relevant online communities ## Tools for Entity Research: ✓ Google Knowledge Graph API ✓ Wikidata Query Service ✓ Wikipedia category analysis
Essential tools, curl commands, Python scripts, and Google search operators for SEO audits and analysis.
Powerful Google search operators for SEO research, competitor analysis, and content auditing.
# Essential Google Search Operators: site:example.com # All indexed pages site:example.com/blog/ # Pages in a directory site:example.com intitle:"keyword" # Pages with keyword in title site:example.com inurl:category # URLs containing a word site:example.com filetype:pdf # Specific file types site:example.com -inurl:www # Non-www pages cache:example.com # View cached version related:example.com # Find similar sites "exact match phrase" # Exact phrase search keyword -excluded # Exclude terms keyword site:.edu # Search on .edu sites intitle:"keyword" # Keyword in title tag inurl:"category" # Word in URL
Useful curl commands to check HTTP headers, redirects, status codes, and server responses.
# Check HTTP status code
curl -o /dev/null -s -w "%{http_code}\n" https://example.com
# Follow redirects and show chain
curl -L -s -o /dev/null -w "%{url_effective}\n" https://example.com
# View full response headers
curl -I https://example.com
# Check if a page is compressed
curl -H "Accept-Encoding: gzip" -I https://example.com
# Simulate Googlebot
curl -H "User-Agent: Googlebot" https://example.com
# Check response time
curl -o /dev/null -s -w "Time: %{time_total}s\n" https://example.com
# Test robots.txt fetch
curl https://example.com/robots.txtA quick Python script to extract all URLs from a sitemap for bulk SEO analysis.
import requests
from bs4 import BeautifulSoup
import csv
def scrape_sitemap(sitemap_url):
"""Extract all URLs from a sitemap."""
resp = requests.get(sitemap_url)
soup = BeautifulSoup(resp.content, 'xml')
urls = []
for loc in soup.find_all('loc'):
urls.append(loc.text)
return urls
# Usage
urls = scrape_sitemap('https://example.com/sitemap.xml')
print(f"Found {len(urls)} URLs")
# Save to CSV
with open('urls.csv', 'w', newline='') as f:
writer = csv.writer(f)
writer.writerow(['URL'])
for url in urls:
writer.writerow([url])Useful XPath expressions for custom extraction in Screaming Frog SEO Spider.
# Screaming Frog Custom Extraction XPath: # Extract all H1 text //h1/text() # Check for missing alt text on images //img[not(@alt)] # Find all external links //a[starts-with(@href, 'http') and not(contains(@href, 'example.com'))] # Extract meta description content //meta[@name='description']/@content # Check for empty title tags //title[normalize-space()=''] # Find canonical URL //link[@rel='canonical']/@href # Count words in content string-length(normalize-space(//body)) # Find schema markup //script[@type='application/ld+json']
Common regular expressions for URL matching, redirect rules, and data extraction in SEO tools.
# Common SEO Regex Patterns:
# Match all URLs in text
https?://[^\s"<>]+
# Extract domain from URL
^(?:https?:\/\/)?(?:www\.)?([^\/]+)
# Match URLs with query parameters
\?[^"<>]+$
# Find URLs ending in .html or .php
\.(html|php)$
# Match URLs with trailing slash
\/$
# Redirect: Remove .html extension
^(.*)\.html$ → $1/
# Redirect: Force lowercase URLs
[A-Z] → lowercase version
# Match dates in URLs (YYYY/MM/DD)
\d{4}\/\d{2}\/\d{2}
# Extract email addresses
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}Copy, paste, and implement 55+ ready-to-use SEO code snippets. From meta tags to advanced technical SEO – everything you need in one cheatsheet.
Bookmark this SEO cheatsheet for quick reference – all snippets are free and always will be.
Get new AI tools, SEO resources, calculators, prompts and free templates delivered to your inbox. No spam, unsubscribe anytime.
By subscribing, you agree to our Privacy Policy. No spam, ever.
Successfully Subscribed!
Thank you for joining the FreeToolr community. Check your inbox for a confirmation email.

FreeToolr is the ultimate platform for free online tools, AI tools, SEO tools, PDF utilities, calculators, image tools and developer resources.
[email protected] Buy Me a Coffee