The Web Developer’s
SEO Cheat Sheet
Important HTML Elements HTTP Status Codes Webmaster Tools
Title Tag Best Practices 200 OK/Success Google Webmaster Tools
<head> 301 Permanent Redirect https://www.google.com/webmasters/tools/home
Less than 512px (50-70 characters) 302 Temporary Redirect Bing Webmaster Tools
<title>Page Title</title> Important keywords near the beginning 404 Not Found http://www.bing.com/toolbox/webmaster/
</head> Each title should be unique 410 Gone (permanently removed) Yandex Webmaster
500 Server Error https://webmaster.yandex.com/
Meta Description Tag Best under 155 characters 503 Unavailable (retry later)
Each description should be unique
<head> Well written descriptions influence More information at
<meta name="description" click-through rate http://mz.cm/HTTP-codes
content="This is an example.">
</head>
Image
<img src="img/keyword.jpg" alt="keyword" width="100" height="100">
Hyperlinks Canonicalization
Text Link Hyperlinking Best Practices Common Duplicate Homepage URLs Canonicalized URL Best Practices
<a href="https://www.example.com/ Preference: HTML links over https://www.example.com Preferred URL = https://example.com/
webpage.html">Keyword in Anchor JavaScript https://example.com
Text</a> Use "nofollow" for paid links and un- https://www.example.com/index.html Place the following in <head> section to
trusted content https://example.com/index.html indicate preferred URL:
NoFollowed Link For image links, the alt attribute serves https://example.com/index.html&sessid=123
<a href="https://www.example.com/ as anchor text <link href="https://example.com/"
webpage.html" rel="nofollow"> rel="canonical" />
Keyword in Anchor Text</a>
More information at http://mz.cm/canonical
Image Link
<a href="https://www.example.com/webpage.html"><img src="/img/
keyword.jpg" alt="keyword" width="100" height="100"></a>
URL Best Practices 1. Protocol SEO Tips for URLs
2. Subdomain
Common URL Elements 3. Root Domain • Choose shorter, human-readable URLs with descriptive keywords
4. Top-Level Domain • Exclude dynamic parameters when possible (see Canonicalization and Pagination)
ht tp s: //s to re . exa m p le . co m /c ate go r y/ key wo rd ? id=1 23 # to p 5. Subfolder/Path • When possible, place content on the same subdomain to preserve authority
6. Page
12 34 5 6 78 7. Parameter Recommended: https://example.com/blog
8. Named Anchor Less Ideal: https://blog.example.com
V3.0 | moz.com | © 2015 SEOmoz
Robots Exclusion Standard Important User Agents
Robots.txt Robots Best Practices For robots.txt, robots meta tags, and X-Robots-Tag
Location: https://example.com/robots.txt
User-agent: googlebot Only Meta Robots and X-Robots Googlebot (can be used Mediapartners-Google
Disallow: /example.html remove URLs from search results as default for most (Mobile Adsense) or
Sitemap: https://example.com/sitemap.xml Don't block CSS or JavaScript files Google crawlers) Mediapartners
More information at http://www.robotstxt.org/robotstxt.html with robots.txt
X-Robots Googlebot-News Googlebot-Mobile
Location: Sent in the HTTP headers Arguments can be: Googlebot-Image Googlebot-Video
AdsBot-Google Bingbot
X-Robots-Tag: noindex Nofollow (do not follow links) Baiduspider Yandexbot
More information at http://noarchive.net/xrobots/ Noindex (do not index) FacebookExternalHit Applebot
Meta Robots Noarchive (do not archive) Slurp Twitterbot
Location: In the html <head> NoODP (Do not show Open Directory * (wildcard for all robots) Rogerbot
Project description)
<meta name="ROBOT NAME" content="ARGUMENTS" /> ...Or combined (noindex, nofollow)
More information at http://www.robotstxt.org/meta.html
If the robots <META> tag is not defined,
the default is "INDEX,FOLLOW"
Sitemap Syntax Default Locations Can Be: Pagination
https://example.com/sitemap.xml
XML Sitemaps https://example.com/sitemap.xml.gz Use rel="next" and rel="prev" in the <head> section
https://example.com/sitemap.gz to indicate the relationship between paginated URLs
<?xml version="1.0" encoding="UTF-8"?> First Page - https://example.com/article
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<link rel="next" href="https://example.com/article?pg=2">
<url>
<loc>https://example.com/</loc> Second Page - https://example.com/article?pg=2
<lastmod>2015-01-01</lastmod>
<changefreq>monthly</changefreq> <link rel="prev" href="https://example.com/article">
<priority>0.9</priority> <link rel="next" href="https://example.com/article?pg=3">
</url> Final Page - https://example.com/article?pg=3
</urlset>
<link rel="prev" href="https://example.com/article?pg=2">
Sitemap Index File Other Common Sitemap Types: More information at http://mz.cm/rel-next
Mobile
<?xml version="1.0" encoding="UTF-8"?> News V3.0 | moz.com | © 2015 SEOmoz 2
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> Image
Video
<sitemap>
<loc>https://example.com/sitemap1.xml.gz</loc>
<lastmod>2015-01-01T18:23:17+00:00</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap2.xml.gz</loc>
<lastmod>2015-01-01</lastmod>
</sitemap>
</sitemapindex>
The Web Developer’s SEO Cheat Sheet
Important Social Metadata Rich Snippets and Structured Data
Sample Meta Tag Template: "Article" Enhance search results and help machines to understand your content
Place this data between the <head> tags of your website Common Vocabularies Popular Formats
schema.org
<!-- Open Graph data --> datavocabulary.org Microdata
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: microformats.org RDFa
http://ogp.me/ns/article#"> JSON-LD
<meta property="og:title" content="Your Title Here" /> Breadcrumbs | Widgets › Large Widgets
<meta property="og:type" content="article" />
<meta property="og:url" content="https://example.com/" /> <ol itemscope itemtype="http://schema.org/BreadcrumbList">
<meta property="og:image" content="https://example.com/image.jpg" /> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta property="og:description" content="Your Description Here" /> <a itemprop="item" href="https://example.com/widgets">
<meta property="og:site_name" content="Your Site Name, i.e. Moz" /> <span itemprop="name">Widgets</span></a>
<meta property="fb:app_id" content="Your FB_APP_ID" /> <meta itemprop="position" content="1" />
</li>
<!-- Twitter Card data -->
<meta name="twitter:card" content="summary"> › <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<meta name="twitter:site" content="Your @publisher_handle"> <a itemprop="item" href="https://example.com/widgets/large">
<meta name="twitter:title" content="Your Page Title"> <span itemprop="name">Large Widgets</span></a>
<meta name="twitter:description" content="Your Page description <meta itemprop="position" content="2" />
less than 200 characters">
<meta name="twitter:creator" content="Your @author_handle"> </li>
<!-- Twitter Summary card images must be at least 120x120px --> </ol>
<meta name="twitter:image" content="https://example.com/image.jpg">
Reviews | Rating: 5.0 - Review by Roger Mozbot
Social Metadata Best Practices <div itemscope itemtype="http://schema.org/Review">
<div itemprop="itemReviewed" itemscope itemtype="http://schema.org/Book">
<span itemprop="name">The Art of SEO</span> </div>
<span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">
<span itemprop="ratingValue">5</span>
</span> stars -
<b>"<span itemprop="name">A good read.</span>" </b>
<span itemprop="author">Roger Mozbot</span>
<span itemprop="reviewBody">The Art of SEO is a good book.</span>
</div>
Default to Open Graph Optimal Image Sizing Common Structured Data Uses Recipes
Events
Platforms that support Open Choose large images over small Media Content
Graph protocol include: Twitter: Business Information Contact Data
People Email Markup
Facebook Minimum 120 x 120px Mobile Apps
Twitter No larger than 1MB
Google+ Facebook:
LinkedIn Minimum 200 x 200px
Pinterest Over 1200 x 630px recommended
More information at http://mz.cm/social-meta More information at http://mz.cm/rich-snippets
The Web Developer’s SEO Cheat Sheet V3.0 | moz.com | © 2015 SEOmoz 3
Targeting Multiple Languages Mobile Web Development
Declare language attribute in the HTML element 1 Responsive Design
<html lang="de"> Place the meta viewport tag in the <head> of the document
<meta name="viewport" content="width=device-width,
URL Structures for Country & Language Targeting initial-scale=1">
ccTLDs (Country Level Only) Subdomains with gTLDS Uses CSS to alter the rendering of the page on the device using
example.de de.example.com/ media queries
Subdirectories with gTLDS <link rel="stylesheet" media="(min-width: 700px)"
example.com/de/ href="min-700px.css">
<style>
rel="alternate" hreflang="x"
@media (min-width:500px) and (max-width:600px)
Annotate alternate language & region versions of content {h1{color:#555}}
</style>
HTML version in <head> (each version must identify all versions, including itself)
2 Dynamic Serving via Vary HTTP Header
<link rel="alternate" hreflang="x-default" href="http://example.com/" /> (Specifies Default)
<link rel="alternate" hreflang="de" href="http://example.com/de/" /> (Specifies Language) Serves different HTML and CSS on the same URL, varied by user agent
<link rel="alternate" hreflang="de-DE" href="http://example.com/de-de/" /> (Specifies Language + Region)
HTTP/1.1 200 OK
Sitemap version Content-Type: text/html
Vary: User-Agent
<?xml version="1.0" encoding="UTF-8"?> Content-Length: 3495
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
(...rest of HTTP response headers...)
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url> 3 Separate URLs
<loc>http://example.com/english/</loc> Identify mobile and desktop versions using
<xhtml:link rel="alternate" hreflang="de" href="http://example.com/deutsch/" /> rel="alternate" and rel="canonical"
<xhtml:link rel="alternate" hreflang="en" href="http://example.com/english/" />
</url> Desktop page: http://example.com/
<url> <link rel="alternate" media="only screen and (max-
<loc>http://example.com/deutsch/</loc> width: 640px)"
<xhtml:link rel="alternate" hreflang="en" href="http://example.com/english/" /> href="https://m.example.com/"/>
<xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/deutsch/" />
</url> Mobile page: http://m.example.com/
</urlset> <link rel="canonical" href="https://example.com/"/>
Popular Languages Popular Regions More language codes can be found at V3.0 | moz.com | © 2015 SEOmoz 4
http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
zh Chinese CN China
es Spanish US United States More region codes can be found at
en English IN India http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
ar Arabic JP Japan
hi Hindi BR Brazil
The Web Developer’s SEO Cheat Sheet