SEO - acnorrisuk/coding-style-guide GitHub Wiki

Site Speed

Improve the site loading speed as much as possible. Fast loading sites allow search engines to crawl websites more efficiently.

Semantic Markup

Use semantic elements wherever appropriate. Non-semantic elements can and should be used for styling purposes

<!-- Examples of semantic elements -->
<section>
<nav>
<aside>
<article>

Rich snippets can be used to provide extra information to search engines about page content. More information on rich snippets can be found at Schema.org.

<div itemscope itemtype="http://schema.org/Event">
    <div itemprop="name">SEO Conference</div> 
    <span itemprop="description">Learn about SEO from experts in the field.</span> 
</div>

Ensure there is a clear structure for each page on the site. There should only be one <h1> on each page.

<h1>Main Heading</h1>
<h2>B Heading</h2>
  <h3>C Heading</h3>

All links should provide relevant anchor text to inform the user of where they will be taken.

<!-- Poor anchor text -->
<a href="products.php">Click here!</a>
<!-- Better anchor text -->
<a href="products.php">View our products</a>

All content images should contain alt text. Images which are purely decorative should use an empty alt attribute

<!-- Descriptive alt text -->
<img src="/cat.jpg" alt="A small cat curled up by a fire">
<!-- Purely decorative image -->
<img src="/background.jpg alt="">

Meta Tags (& title)

Page titles should be unique and clearly describe the contents of the page. Brand names can be added at the end of a title via a separator.

<title>How to write a great title | MyBlog.com</title>

Meta-descriptions should be added for key pages as these show up directly on the SERPs.

<!-- An example of a meta description -->
<meta name="description" content="This is an example of a meta description. Try to keep to under 160 characters">

Keywords should not be used as they are ignored by search engines

<!-- keywords look spammy to search engines -->
<meta name="keywords" content="..."

URLs

Ensure URLs are human readable. Words in URLs should be separated by hyphens. Stop words (such as 'and', 'but', 'or') can be omitted to prevent lengthy URLs.

# Hard for users and search engines to understand
http://www.mysite.com/?p=233445/
# Much clearer
http://www.mysite.com/about-us/

Ensure there is a consistent URL structure throughout the site. Avoid using too many subdirectories.

# Possibly too many subdirectories
http://www.mysite.com/blog/category/theme/mypost/
# Much cleaner
http://www.mysite.com/blog/mypost/
# Also valid
http://www.mysite.com/mypost/

Links

Check frequently for broken internal and external links. See screaming frog

Periodically review backlinks and disavow any suspicious or spammy sources using Google Search Console.

Redirects

Use 301 redirects to ensure there is only one path to each page.

# Alternate URLs should be 301 redirected
http://www.mysite.com
http://mysite.com
https://www.mysite.com
https://mysite.com

Ensure there is a canonical version of each URL to prevent duplication issues.

<link rel="canonical" href="http://example.com/page/">

Indexing

Sites should contain a sitemap.xml file. This should be submitted to search engines to help them index content.

On sites which involve taxonomies these can quickly grow into hundreds of unique URLs and should be hidden to search engines to help make the site easier to crawl and index.

User-agent: *
Disallow: /archives/
Disallow: /category/

Alternatively, a meta robots element can be added to the archive pages to prevent indexing.

<meta name="robots" content="noindex,follow">
⚠️ **GitHub.com Fallback** ⚠️