Best Practices

Updated: 2019-01-07

These are some best practices that I've learned by building this website, they should be useful for other content-heavy websites, including blogs; especially statically generated ones.

Google Analytics and Google Webmaster

Probably the first thing you need to do is to setup Google Analytics and Webmaster, you simply cannot improve it if you cannot measure it. And make sure you generate a sitemap and add it to Webmaster.

Alexa is useful for checking the overall websites rankings, but the result is estimated, do not put too much weight on it.

Use HTTPS and HTTP/2

HTTPS makes it secure, HTTP/2 makes it fast. CloudFlare can provide it, for free. Add Always Use HTTPS rule to URL http://*example.com/*

Prefer Static Websites

If you want to create a wordpress blog website, think again. Static websites are much easier to manage, you do not need to maintain your server and database. Deploying it to a cloud storage like S3 is super cheap, and fast to visit. This website is using GatsbyJS.

No Empty Or Thin Pages

Search engines prefer longer articles; Google AdSense would reject you if you do not have enough content, or empty pages.

No Scraped Content

Google AdSense would also reject you if your content is copy-and-paste from other websites. Of course they are not publishing the standard, but I do not think quoting just one line would disqualify you, the baseline is that you need to provide some extra value to your audience. So if you want to borrow some content, at least try to understand the gist and rephrase in your own words.

Use Google's Lighthouse To Audit Your Website

Now Lighthouse is integrated into Chrome's Developer Tools, you can find the last tab called "Audits", you will get scores and improvement suggestions.

PWA and AMP

Both originated from Google. Even if you do not care about them, rumors say that Google uses them for ranking. So at least have some basic setup may be worth it. Gatsby has gatsby-plugin-manifest and gatsby-plugin-offline that can fulfill PWA's requirements.

No Trailing Slash

So that the count of the pageviews is accurate. If you are using Gatsby, add this plugin to your object: gatsby-plugin-remove-trailing-slashes.

Deadlinks may hurt your ranking. Use a tool to check deadlinks, e.g. broken-link-checker

Privacy Policy

Make sure you have a privacy policy page, and make it easily accessible. Some ads or affiliate networks do not require the privacy policy(you still should have it) but ask you to disclaim that you are affiliated and earn money from displaying their ads. Read carefully.

Be Patient

Especially if you rely on organic search traffic. Search engines may "freeze" your website upon its creation for at least 6 months before they start to index the content, even after that the "age" of the website may(or may not, we do not know) be a variable for ranking.

Forward example.com to www.example.com

Add CloudFlare rule:

  • example.com/*

    • Forwarding URL
    • 301 Permanent Redirect
    • https://www.example.com/$1