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 attribute 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.2 | moz.com | © 2 0 1 3 - 2 0 1 4 S E O m o z 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 Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 (Mobile Smartphones) like Mac OS X) AppleWebKit/536.26 <meta name="ROBOT NAME" content="ARGUMENTS" /> (KHTML, like Gecko) Version/6.0 If the robots <META> tag is not defined, Mobile/10A5376e Safari/8536.25 More information at http://www.robotstxt.org/meta.html the default is "INDEX,FOLLOW" (compatible; Googlebot/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.2 | moz.com | © 2013-2014 SEOmoz 2 Important Metadata Google Authorship & Publisher Facebook Open Graph Google+ Authorship Google+ Publisher author information in Google businesses, brands, products and <head> For search results: organizations: <meta property="og:title" content="Title Goes Here"> Link your content to your Link your homepage to your <meta property="og:description" content="description-goes-here"> Google+ profile Google+ profile <meta property="og:type" content="your-content-type-goes-here"> (e.g., "article") 1 <meta property="og:url" content="http://www.your-site.com/"> <a href="[profile_ <a href="[profile_ url]?rel=author">Google</a> url]?rel=publisher">Google</a> <meta property="og:image" content="http://www.your-site.com/image.jpg"> <meta property="og:site_name" content="your-site-name"> Link back to your site from the Link to your website from your <meta property="fb:admins" content="your-Facebook-page-user-ID"> 2 ‘Contributor’ section of your Google+ page's profile </head> Google+ profile More information at https://developers.facebook.com/docs/opengraph/ More information at More information at http://mz.cm/google-author http://mz.cm/google-publisher Twitter Cards <head> <meta name="twitter:card" content="summary"> <meta name="twitter:url" content="http://www.example.com/your-url-goes-here/"> Pagination <meta name="twitter:title" content="Title Goes Here"> <meta name="twitter:description" content="Your description goes here."> Use rel="next" and rel="prev" in the <head> section <meta name="twitter:image" content="http://example.com/image.jpg"> to indicate the relationship between paginated URLs </head> First Page - http://example.com/article More information at https://dev.twitter.com/docs/cards <link rel="next" href="http://example.com/article?pg=2"> Google+ Second Page - http://example.com/article?pg=2 Google+ will extract information from Open Graph properties, title and meta description tags, or Schema.org microdata (recommended). <link rel="prev" href="http://example.com/article"> <link rel="next" href="http://example.com/article?pg=3"> <html itemscope itemtype="http://schema.org/Article"> <head> Final Page - http://example.com/article?pg=3 <meta itemprop="name" content="Title Goes Here"> <meta itemprop="description" content="Description Goes Here"> <link rel="prev" href="http://example.com/article?pg=2"> <meta itemprop="image" content="http://example.com/image.jpg"> </head> More information at https://developers.google.com/+/web/snippet/ More information at http://mz.cm/rel-next The Web Developer’s SEO Cheat Sheet V2.2 | moz.com | © 2013-2014 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>