Sunteți pe pagina 1din 4

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> Less than 512px (50-70 characters) 301 Permanent Redirect
https://www.google.com/webmasters/tools/home
<title>Page Title</title> Important keywords near the beginning 302 Temporary Redirect
</head> Each title should be unique 404 Not Found Bing Webmaster Tools
Meta Description Tag 410 Gone (permanently removed)
http://www.bing.com/toolbox/webmaster/
<head> Best under 155 characters 500 Server Error
<meta name="description" Each description should be unique
content="This is an example.">
503 Unavailable (retry later) Yandex Webmaster
Well written descriptions influence
</head> click-through rate More information at https://webmaster.yandex.com/
http://mz.cm/HTTP-codes
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
webpage.html">Keyword in Anchor https://www.example.com Preferred URL = https://example.com/
JavaScript
Text</a>
Use "nofollow" for paid links and un- https://example.com Place the following in <head> section to
NoFollowed Link trusted content indicate preferred URL:
<a href="https://www.example.com/ https://www.example.com/index.html
For image links, the alt attribute serves
webpage.html" rel="nofollow"> <link href="https://example.com/"
as anchor text
Keyword in Anchor Text</a> rel="canonical" />
https://example.com/index.html
Image Link
<a href="https://www.example.com/webpage.html"><img src="img/ https://example.com/index.html&sessid=123 More information at http://mz.cm/canonical
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
https://store.example.com/category/keyword?id=123#top 4. Top-Level Domain • Exclude dynamic parameters when possible (see Canonicalization and Pagination)

1 2 3 4 5 6 7 8
5. Subfolder/Path
• When possible, place content on the same subdomain to preserve authority
6. Page
7. Parameter Recommended: https://example.com/blog
8. Named Anchor Less Ideal: https://blog.example.com

V3.0 | moz.com | © 2015 SEOmoz


Robot Control Syntax Important User Agents
Robots.txt
Location: https://example.com/robots.txt Robots Best Practices For robots.txt, robots meta tags, and X-Robots-Tag

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
with robots.txt
More information at http://www.robotstxt.org/robotstxt.html
Googlebot-News Googlebot-Mobile
X-Robots Arguments can be:
Location: Sent in the HTTP headers Googlebot-Image Googlebot-Video

X-Robots-Tag: noindex Nofollow (do not follow links) Bingbot


AdsBot-Google
Noindex (do not index)
More information at http://noarchive.net/xrobots/ Noarchive (do not archive) Baiduspider Yandexbot
Meta Robots NoODP (Do not show Open Directory
Location: In the html <head> Project description) FacebookExternalHit Applebot
...Or combined (noindex, nofollow)
Slurp Twitterbot
<meta name="ROBOT NAME" content="ARGUMENTS" />
If the robots <META> tag is not defined,
More information at http://www.robotstxt.org/meta.html the default is "INDEX,FOLLOW" * (wildcard for all robots) Rogerbot

Sitemap Syntax Pagination


XML Sitemaps Default Locations Can Be: Use rel="next" and rel="prev" in the <head> section
<?xml version="1.0" encoding="UTF-8"?>
to indicate the relationship between paginated URLs
https://example.com/sitemap.xml
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc> https://example.com/sitemap.xml.gz First Page - https://example.com/article
<lastmod>2015-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority> https://example.com/sitemap.gz <link rel="next" href="https://example.com/article?pg=2">
</url>
</urlset>
Second Page - https://example.com/article?pg=2
Sitemap Index File Other Common Sitemap Types:
<link rel="prev" href="https://example.com/article">
<?xml version="1.0" encoding="UTF-8"?>
Mobile <link rel="next" href="https://example.com/article?pg=3">
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap1.xml.gz</loc>
News
<lastmod>015-01-01T18:23:17+00:00</lastmod> Final Page - https://example.com/article?pg=3
</sitemap> Image
<sitemap>
<loc>https://example.com/sitemap2.xml.gz</loc> Video <link rel="prev" href="https://example.com/article?pg=2">
<lastmod>2015-01-01</lastmod>
</sitemap>
</sitemapindex> More information at http://mz.cm/rel-next

The Web Developer’s SEO Cheat Sheet V3.0 | moz.com | © 2015 SEOmoz 2
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 Microdata
datavocabulary.org RDFa
<!-- Twitter Card data -->
microformats.org JSON-LD
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="[@publisher_handle]"> Breadcrumbs
<meta name="twitter:title" content="[Page Title]"> Widgets > Large Widgets
<meta name="twitter:description" content="[Page description
<div id="a" itemscope itemtype="http://data-vocabulary.org/Breadcrumb" itemref="b">
less than 200 characters]">
<a href="https://example.com/widgets" itemprop="url">
<meta name="twitter:creator" content="[@author_handle]"> <span itemprop="title">Widgets</span>
</a>
<!-- Twitter Summary card images must be at least 120x120px --> </div>
<meta name="twitter:image" content="[https://example.com/image.jpg]"> <div id="b" itemscope itemtype="http://data-vocabulary.org/Breadcrumb"
itemprop="child">
<a href="https://example.com/widgets/large" itemprop="url">
<span itemprop="title">Large Widgets</span>
<!-- Open Graph data -->
</a>
<meta property="og:title" content="[Title Here]" /> </div>

<meta property="og:type" content="[article]" />


<meta property="og:url" content="[https://example.com/]" />
Reviews

<meta property="og:image" content="[https://example.com/image.jpg]" /> Rating: 5.0 - Review by Roger Mozbot

<meta property="og:description" content="[Description Here]" /> <div itemscope itemtype="http://schema.org/Review">


<meta property="og:site_name" content="[Site Name, i.e. Moz]" /> <div itemprop="itemReviewed" itemscope itemtype="http://schema.org/Book">
<span itemprop="name">The Art of SEO</span> </div>
<meta property="fb:app_id" content="[FB_APP_ID]" /> <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>
Social Metadata Best Practices <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

Platforms that support Open Choose large images over small Common Structured Data Uses
Graph protocol include: Twitter:
Events Recipes
Facebook Minimum 120 x 120px
Twitter No larger than 1MB Business Information Media Content
Google+ Facebook:
People Contact Data
LinkedIn Minimum 200 x 200px
Pinterest Over 1200 x 630px recommended Mobile Apps Email Markup

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="fr"> 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.0">

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)"


href="min-700px.css">
example.com/de/
<style>
@media (min-width:500px) and (max-width:600px)
rel="alternate" hreflang="x" {h1{color:#555}}
</style>
Annotate alternate language & region versions of content

HTML version in <head>


<link rel="alternate" hreflang="x-default" href="https://example.com/" /> (Specifies Default)
2 Dynamic Serving via Vary HTTP Header

<link rel="alternate" hreflang="de" href="https://example.com/de/" /> (Specifies Language)


Serves different HTML and CSS on the same URL, varied by user agent
<link rel="alternate" hreflang="de-ES" href="https://example.com/de-es/" /> (Specifies Language + Region)

HTTP/1.1 200 OK
Sitemap version
Content-Type: text/html
<?xml version="1.0" encoding="UTF-8"?>
Vary: User-Agent
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
Content-Length: 3495
<url>
<loc>https://example.com/english</loc> (...rest of HTTP response headers...)
<xhtml:link rel="alternate" hreflang="de" href="https://example.com/deutsch/" />
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/english/" />
</url>
<url>
<loc>http://example.com/deutsch/</loc>
3 Separate URLs

<xhtml:link rel="alternate" hreflang="en" href="https://example.com/english/" /> Identify mobile and desktop versions using
<xhtml:link rel="alternate" hreflang="de" href="https://www.example.com/deutsch/" /> rel="alternate" and rel="canonical"
</url>
</urlset>
Desktop page: http://example.com/
<link rel="alternate" media="only screen and (max-
Popular Languages Popular Regions
More language codes can be found at width: 640px)"
zh Chinese CN China http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes href="https://m.example.com/"/>
es Spanish US United States
en English IN India Mobile page: http://m.example.com/
More region codes can be found at
ar Arabic JP Japan http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 <link rel="canonical" href="https://example.com/"/>
hi Hindi BR Brazil

The Web Developer’s SEO Cheat Sheet V3.0 | moz.com | © 2015 SEOmoz 4

S-ar putea să vă placă și