SEO Cheat Sheet
Total Page:16
File Type:pdf, Size:1020Kb
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> No longer than 60-80 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> No longer than 155 characters 500 Server Error <meta name="description" Each description should be unique 503 Unavailable (retry later) Yandex Webmaster Tools content="This is an example."> Well written descriptions influence </head> click-through rate More information at http://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="http://www.example.com/ Limit links per page to roughly 150 webpage.html">Keyword in Anchor http://www.example.com http://www.example.com/ Text</a> Use "nofollow" for paid links and untrusted content http://example.com rel="canonical" NoFollowed Link <a href="http://www.example.com/ For image links, the alt tags serves as anchor text http://www.example.com/index.html <link href="http://www.example.com/" webpage.html" rel="nofollow"> rel="canonical" /> Keyword in Anchor Text</a> http://example.com/index.html Image Link <a href="http://www.example.com/webpage.html"><img src="img/ http://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 • Use descriptive keywords in URLs http://store.example.com/category/keyword?id=123#top 4. Top-Level Domain • Watch for duplicate content when using multiple parameters 5. Subfolder/Path • When possible, place content on the same subdomain to preserve domain authority 1 2 3 4 5 6 7 8 6. Page 7. Parameter Recommended: http://example.com/blog 8. Named Anchor Less Ideal: http://blog.example.com V2.0 | moz.com | © 2013 SEOmoz Robot Control Syntax Important User-agents Robots.txt Robots Best Practices For robots.txt, robots User-agent in HTTP(S) requests Location: http://example.com/robots.txt meta tags & X-Robots-Tag User-agent: googlebot While robots.txt may restrict Disallow: /no-google.html crawling, only Meta Robots and Googlebot (can be Mozilla/5.0 (compatible; Googlebot/2.1; Sitemap: http://example.com/sitemap.xml X-Robots will remove URLs from used as default for most +http://www.google.com/bot.html) search results. Google crawlers) More information at http://www.robotstxt.org/robotstxt.html Googlebot-News Googlebot-News X-Robots Arguments can be: Location: Sent in the HTTP headers Googlebot-Image Googlebot-Image/1.0 X-Robots-Tag: noindex Nofollow (do not follow links) Noindex (do not index) Googlebot-Mobile [various mobile device types] (compatible; Googlebot-Mobile/2.1; +http://www. More information at http://noarchive.net/xrobots/ Noarchive (do not archive) google.com/bot.html) Meta Robots NoODP (Do not show Open Directory Location: In the html <head> Project description) ...Or combined (noindex, nofollow) Googlebot-Mobile Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 (Mobile Smartphones) like Mac OS X; en-us) AppleWebKit/532.9 <meta name="ROBOT NAME" content="ARGUMENTS" /> (KHTML, like Gecko) Version/4.0.5 If the robots <META> tag is not defined, Mobile/8B117 Safari/6531.22.7 (compatible; More information at http://www.robotstxt.org/meta.html the default is "INDEX,FOLLOW" Googlebot-Mobile/2.1; +http://www.google. com/bot.html) Mediapartners-Google [various mobile device types] (compatible; Sitemap Syntax (Mobile Adsense) or Mediapartners-Google/2.1; +http://www. Mediapartners google.com/bot.html) XML Sitemaps Default Locations <?xml version="1.0" encoding="UTF-8"?> http://www.example.com/sitemap.xml Mediapartners (Adsense) Mediapartners-Google <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://www.example.com/</loc> http://www.example.com/sitemap.xml.gz Bingbot Mozilla/5.0 (compatible; bingbot/2.0; <lastmod>1970-01-01</lastmod> +http://www.bing.com/bingbot.htm) <changefreq>monthly</changefreq> <priority>0.8</priority> http://www.example.com/sitemap.gz </url> Baiduspider Mozilla/5.0 (compatible; Baiduspider/2.0; </urlset> +/web/20130307230956/http://www. baidu.com/search/spider.html) Sitemap Index File Other Common Sitemap Types: Yandexbot Mozilla/5.0 (compatible; YandexBot/3.0; <?xml version="1.0" encoding="UTF-8"?> Mobile <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> +http://yandex.com/bots) <sitemap> <loc>http://www.example.com/sitemap1.xml.gz</loc> News <lastmod>2004-10-01T18:23:17+00:00</lastmod> FacebookExternalHit facebookexternalhit/1.1 (+http://www. </sitemap> Image facebook.com/externalhit_uatext.php) <sitemap> <loc>http://www.example.com/sitemap2.xml.gz</loc> Video <lastmod>2005-01-01</lastmod> Rogerbot Mozilla/5.0 (compatible; rogerBot/1.0; </sitemap> UrlCrawler; http://moz.com/help/pro/ </sitemapindex> rogerbot-crawler) The Web Developer’s SEO Cheat Sheet V2.0 | moz.com | © 2013 SEOmoz 2 Important Metadata Facebook Open Graph Google+ Authorship <head> For author information in Google search results: <meta property="og:title" content="Title Goes Here"> <meta property="og:description" content="description-goes-here"> 1 Link your content to your Google+ profile <meta property="og:type" content="your-content-type-goes-here"> (e.g., "article") <meta property="og:url" content="http://www.your-site.com/"> <a href="[profile_url]?rel=author">Google</a> <meta property="og:image" content="http://www.your-site.com/image.jpg"> <meta property="og:site_name" content="your-site-name"> <meta property="fb:admins" content="your-Facebook-page-user-ID"> Link back to your site from the ‘Contributor’ </head> 2 section of your Google+ profile More information at https://developers.facebook.com/docs/opengraph/ More information at Twitter Cards https://support.google.com/webmasters/answer/2539557 <head> <meta name="twitter:card" content="summary"> <meta name="twitter:url" content="http://www.example.com/your-url-goes-here/"> <meta name="twitter:title" content="Title Goes Here"> Google+ Publisher <meta name="twitter:description" content="Your description goes here."> <meta name="twitter:image" content="http://example.com/image.jpg"> For businesses, brands, products and organizations: </head> More information at https://dev.twitter.com/docs/cards 1 Link your homepage to your Google+ profile Google+ <a href="[profile_url]?rel=publisher">Google</a> Google+ will extract information from Open Graph properties, title and meta description tags, or Schema.org microdata (recommended). <html itemscope itemtype="http://schema.org/Article"> 2 Link to your website from your Google+ page's profile <head> <meta itemprop="name" content="Title Goes Here"> More information at <meta itemprop="description" content="Description Goes Here"> https://support.google.com/webmasters/answer/1708844 <meta itemprop="image" content="http://example.com/image.jpg"> </head> More information at https://developers.google.com/+/web/snippet/ The Web Developer’s SEO Cheat Sheet V2.0 | moz.com | © 2013 SEOmoz 3 Targeting Multiple Languages Mobile Web Development Declare language attribute in the HTML element 1 Responsive Design <html lang="fr"> Uses CSS to alter the rendering of the page on the device using media queries URL Structures for Country & Language Targeting Example: ccTLDs (Country Level Only) Subdomains with gTLDS /* Phones */ @media (max-width: 767px) { ... } example.de de.example.com/ Subdirectories with gTLDS /* Tablets to Desktops */ @media (min-width: 768px) and (max-width: example.com/de/ 992px) { ... } rel="alternate" hreflang="x" /* Large devices */ @media (min-width: 1200px) { ... } Annotate alternate language & country versions of content HTML version in <head> Dynamic Serving via Vary HTTP Header <link rel="alternate" hreflang="x-default" href="http://www.example.com/" /> (Specifies Default) 2 <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-ES" href="http://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: 5710 <url> <loc>http://example.com/english</loc> (...rest of HTTP response headers...) <xhtml:link rel="alternate" hreflang="de" href="http://example.com/deutsch/" /> <xhtml:link rel="alternate" hreflang="en" href="http://example.com/english/" /> </url> <url> 3 Separate URLs <loc>http://example.com/deutsch/</loc> <xhtml:link rel="alternate" hreflang="en" href="http://example.com/english/" /> Identify mobile and desktop versions using rel="alternate" <xhtml:link rel="alternate" hreflang="de" href="http://www.example.com/deutsch/" /> 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)" ch Chinese CN China http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes href="http://m.example.com/"/> es Spanish US United States en English IN India More region codes can be found at Mobile page: http://m.example.com/ ar Arabic JP Japan http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 <link rel="canonical" href="http://example.com/"/> hi Hindi BR Brazil The Web Developer’s SEO Cheat Sheet V2.0 | moz.com | © 2013 SEOmoz 4.