Guide To Speed Up Site in China

How to Improve Website Speed in China | Optimize Loading Time (Cover Image)

Yes, there’s a bunch of websites that discuss tips to optimize the speed of your website in China. However, few of them are brutally outdated, and the rest may sound complicated to bloggers and entrepreneurs with little to no experience. Skip introduction.

February 08, 2019: Planning to start a new blog in China? I’ve prepared the definitive guide to start a blog. Purchase ExpressVPN or SocketPro subscription (if you’re in China) and build your blog based on Namecheap, DigitalOcean, GeneratePress, and Cloudflare.

I’ve prepared this guide for newbie bloggers and small to medium-sized businesses that run a website or blog, intended to cater to both international and Chinese users.

If you are planning to set up a brand new WordPress site, go ahead read my blog post on “How to Start A WordPress Blog in China.”

Bonus: I’d bust some common myths via this article. E.g., “host your site in China for the best speed,” “WordPress won’t work well in China” etc.

Now buckle up and start optimizing your website for China.

8 Steps to optimize the speed of your website in China

Step 1: Monitor The Website Performance

The first thing to do is to understand your website’s loading speed in the greater China region. Services like tools.pingdom.com and PageSpeed Insights (Google) are great.

The only problem is Pingdom free version doesn’t allow you to test from Asia – China region and Google usually pings your site from US IPs.

Need an alternative? Here’s a list of free tools to test website load time from China

  • https://www.webpagetest.org
  • https://www.site24x7.com/web-page-analyzer.html
  • https://www.dotcom-tools.com/website-speed-test.aspx
  • https://ce.baidu.com/index/performance (You need to sign-up)

Usually, after a first test run, these sites will give you tips on how to improve the loading time. These tips are great, but you need to go further to optimize the site for China.

Fun Fact: mighil.com loads faster than a digital marketing agency based in Shanghai that wrote an article on the same topic (real bummer, innit?).

Mighil.com Loading Time, Shanghai, 3.1 Seconds.
Performance Summary of Mighil.com.

Now here are some workarounds to make your optimize your website and the server so that the site content will render fast!

Step 2: Reduce TTFB

Google defines TTFB as a period of “waiting”:

Time spent waiting for the initial response, also known as the Time To First Byte.

This time captures the latency of a round trip to the server in addition to the time spent waiting for the server to deliver the response.

Read More About TTFB on Wikipedia

webpagetest.org indicates your site’s TTFB in the “First Byte” section of the results page.

There are “n” number of methods to reduce First Byte Time. But, I’d suggest finding the root of the problem before changing the host or purchasing a CDN service.

You could initiate a chat with your webmaster or hosting provider first, get insights from them, then decide what to do next.

Here are some recommended best practices to reduce First Byte Time.

1. Improve the server configuration: These methods will vary according to what web server you are using. A lot of readers aren’t tech-savvy, so it is wise to leave this duty to your webmaster. Ask your webmaster to optimize Apache or NGINX for better TTFB. Head over to https://stackoverflow.com to view recommendations and insights that may sound optimal for you.

2. Use a CDN: Using a good quality CDN can help deliver your static content, like images and scripts, faster to users via a network of servers worldwide. Aliyun (from Alibaba), Tencent Cloud CDN and Akamai are some of the best CDN service providers for China.

Pro Tip: Do not have the budget to buy a premium CDN service? The cheapest workaround is to move your server to Hong Kong or Singapore region. Digital Ocean‘s Singapore node servers work flawlessly in China.

Warning: Cloudflare CDN (free package) is known for its high TTFB. Do no use Cloudflare CDN’s free service to improve TTFB; it’ll work the other way around.

Step 3: Reduce The Website Page Size

Waterfall Chart of Mighil.com, 138.32KB in Total.
Waterfall Chart for Mighil.com.

Yeah, it’s the modern age. Everyone has better internet at home or at work. But that doesn’t mean you’ve to create a 10MB index page. The site load time will go up if you don’t reduce your web page’s size. It’ll affect your ranking also.

Ideally, your website should load within 4 seconds at least (if it’s not hosted in China). You should compress whenever it’s necessary. Do not use a site builder like WPBakery if you are using WordPress. WPBakery’s CSS is quite bloated in my opinion.

Step 4: Use lightweight WordPress Themes

WordPress, Joomla, and Magento are great content management systems and e-commerce platforms to manage blogs and e-commerce stores.

For example, if you are maintaining a blog based on WordPress that caters Chinese audience, you should stick with optimal settings when it comes to the themes. There’s a ton of “heavy” WordPress themes that may potentially decrease the performance of your site.

But, WordPress is Blocked in China, right?

No. WordPress sub-domain loads blazing fast in China.

Or use Baidu; you can find mirror links to download WP package anyway.

WordPress is famous here, and I know few people who run a WordPress blog in China by throwing Cloudflare on top of it. However, a lot of Chinese web devs or companies don’t prefer WordPress in general as a CMS platform. They tend to build their own CMS based on PHP or Node.js etc.

And local bloggers in general, they prefer Chinese CMSs or blogging platforms over WP. I moderate Chengdu Living, an expat community-focused website based on WP. And it works well without a VPN. Same with this site, mighil.com. Feel free to check out my WP beginners guide for bloggers in China for more detailed info.

I’d suggest GeneratePress framework (developed by Tom Usborne) if you’re building a new site intended to the users in China.

GeneratePress is insanely lightweight, and it loads very fast. Read my GeneratePress WordPress theme review if you’re interested.

Look at mighil.com for example. My site is built on GeneratePress framework and powered by a San Francisco based server. Still, it promises a decent load time (2 to 4 seconds) in China.

Speed Up Your Site With GeneratePress

The best framework for any site in China.

Get it Here.

Step 5: Usage Of Web Fonts or Fonts in General

Web font usage is another important factor when it comes to slowing down your websites in China.

Don’t even think about using Google fonts or Adobe Typekit fonts. Both works if you’ve got an optimized CDN. But it is still not recommended to fetch fonts from GFW blocked resources.

Here are a few alternatives:

Google Font Alternative for China

google-webfonts-helper” lets you download your favorite Google fonts for offline use.

Google Font Alternative for China, google-webfonts-helper by Mario Ranftl
Visit https://google-webfonts-helper.herokuapp.com/fonts/

Which means, you can download Google fonts to your PC in .otf formats, upload to your server and fetch them directly using @font-face in the stylesheet.

Adobe Typekit Alternative for China

Quite tricky. You should completely avoid Adobe Typekit and purchase the license for the fonts from the designers. Then you could upload eot, ttf, svg, woff and woff2 files and use them within your CSS snippet.

Use System Font Stacks

Recommended approach if you want the site to load even faster. A “system font stack” is a way of telling the web browser to use the font your operating system is already using.

So, what’s your call? A website with custom fonts (that adds at least 100kb page-size + respective loading time) or the one that loads blazing fast?

Here’s an example code snippet you could use in the CSS:

body * {font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";}

Step 6: Inspecting Links To External Resources

Make sure your site(s)’ CSS, images, video files or JavaSCript does not load from external resources blocked by Chinese internet a.k.a the GFW.

The best approach is to host everything locally (recommended) or use a CDN optimized for China.

Step 7: WordPress Caching

Running a blog based on WordPress (CMS)? Make use of a caching plugin called Autoptimize developed by Frank Goossens (futtta). Autoptimize makes optimizing your site easy. It can aggregate, minify and cache scripts and styles, injects CSS in the page head by default (but can also defer), moves and defers scripts to the footer and minifies HTML.

The “Extra” options allow you to optimize Google Fonts and images, async non-aggregated JavaScript, remove WordPress core emoji cruft and more.

Autoptimize

Step 8: Hire Someone

Last resort. Hire a web performance expert if you aren’t able to optimize everything by yourself. I’d also recommend this to people with little to no working knowledge of HTML, servers or CMS in general.

I do offer such services for a price of flat 100USD per audit and 50USD per hour for on-page/server optimization. I provide custom speed up services for your site on any hosting platform: shared, VPS or dedicated (ranging from DigitalOcean to Aliyun).

Speed Up Your Site Today!

Get in touch with me to optimize your site and server

Send a message!

Koji: Gutenberg-Ready Theme

Free Minimal Gutenberg WordPress Theme

Looking for the best minimal WordPress theme compatible with Gutenberg? Here’s Koji. Developed by Anders Norén, Koji is a stunning light-weight theme that focuses on content. The Koji theme promises a pleasant browsing/scrolling experience also.

Note: This is not a promotion. Koji is simply great, and I’d recommend this minimal Gutenberg theme anytime.

Update: I’m using GeneratePress WordPress theme right now. Visit https://go.mighil.com/koji kaijudigital.org to view the demo of Koji. Kaiju Digital (WIP) will be based on this Gutenberg-friendly minimal WordPress theme.

Koji WordPress Theme Preview

Koji

Koji is ideal for freelancers and bloggers who embrace minimalism. The theme emphasizes your content and loads blazing fast on modern browsers and all devices.

Why I use Koji

I was in search of a Gutenberg compatible theme that’s minimal. I love GeneratePress (which is minimal and compatible with Gutenberg as well), but I wanted something even light-weight and easy to use. I didn’t need a lot of options and customizations GeneratePress offered. Koji looked ideal for me.

I do recommend GeneratePress if you prefer to make money from blogging. It’s a great framework. Check my GeneratePress review for more details.

Koji is ideal for small personal websites like mine with lots of images and text-based content.

Clean Design, Speed & Typography

As you can see, Koji renders your system font stack which makes the website load faster on all devices. The smooth animations also promise a better experience for your readers. This feature makes Koji the best fit for photography based blogs and portfolio websites.

Gutenberg Support

It’s clear that the developer has built Koji with the new WordPress Gutenberg editor in mind. The theme has full support for blocks and editor styles. It also supports the classic editor.

What I’ve Done With Koji

I’ve edited Koji’s stylesheet a bit to fit my needs. I’ve also replaced some png files with Base64 strings. My site’s sidebar area and headings are styled to render Sofia Pro font. I’m not using the social icons that came with Koji theme. I use Lightweight Social Icons developed by Thomas Usborne.

PageSpeed Insights & Pingdom Website Speed Test Result

Keep in mind that kaijudigital.org is based on CentOS, NGINX,MariaDB, & PHP-FPM, and the server is optimized for better load time. I use Autoptimize plugin developed by Frank Goossens (futtta) to reduce the file requests and compress other stuff.

These were the results of mighil.com + Koji WordPress theme. Go ahead and check kaijudigital.org’s performance score if you’re still worried about the page loading speed.

The speed score on Desktop
Mobile
The speed score on Mobile.

Here’s the Pingdom Website Speed Test Result:

Take a look at the Pingdom Page Performance Grades:

No, I don’t use a CDN service. I’m using CloudFlare free service at the moment.

So, if you are looking to install a best minimal Gutenberg compatible WordPress theme, go ahead and get Koji for free from the WordPress theme directory, or install it through your WordPress administration panel at Appearance → Themes → Add New.


Need a hand?

Need help optimizing your WordPress website to achieve better load-time and search performance? Connect with me now.


SparrowX, Jekyll + Netlify CMS Boilerplate

Jekyll + Netlify CMS with SparrowX Theme

SparrowX is a clean, minimal, SEO-friendly Jekyll theme you can download right now. It is 100% Netlify compatible. Updated demo link – https://sparrowx.netlify.com

The SparrowX

So, I’ve been testing Netlify last week and came across Netlify CMS. The CMS is pretty easy to set up, and it’d be a wise choice for people who don’t want to spend money on hosting.

But SEO… yeah that’s a problem when it comes to Jekyll themes. Sure, you can optimize Jekyll a lot, but it’s hard for people with no development knowledge to setup Jekyll + Netlify CMS manually.

My search for a clean, minimal Jekyll theme ended when I found sparrow on GitHub. Developed by lingxz, it’s a solid theme that can be used as a boilerplate.

So I took the base theme, improved loading speed, added many features for SEO and made it to a Jekyll + Netlify-CMS boilterplate.

SparrowX Jekyll Theme for Netlify CMS
Home page screenshot.

Legacy Features

  • Fully compatible with Github Pages
  • Configurable and responsive multi layer menu, adapted from slimmenu
  • Disqus integration
  • Font Awesome icons included
  • Google analytics
  • Social sharing using rrssb
  • 404 page included
  • Typographic optimization for Chinese fonts
  • Atom feed generated with jekyll-feed
  • Pagination enabled for blog using jekyll-paginate
  • Basic SEO with Facebook Open Graph tags and Twitter cards

New Features

  • Fully compatible with Netlify CMS (one-click setup).
  • Added new custom variables like updated, headerimage, feature-img, sitemap and tag.
  • The theme renders system font-stack.
  • Compressed JS.
  • Improved load time and reduced file requests.
  • _redirects feature

Website Speed Test

How To Use This Theme

Visit this page to read the SparrowX documentation for Netlify CMS.

Install

Just fork this repo and replace the posts with your own. Also, rename the sample poetry collection to replace it with your own collection, or just delete it if you don’t need to use collections. The example is poetry, but you can easily revamp this into essays, short stories, portfolio, or whatever your creative work is.

General configuration

Customize these values in the  _config.yml file:

title                    : "SparrowX"
description              : "A clean minimal Jekyll theme for SEO-focused writers."
favicon                  : "/assets/images/image.png" # You can use base64 encoded images.
url                      : "https://sparrowx.mighil.com" # the base hostname & protocol for your site e.g. "https://mmistakes.github.io"
baseurl                  : "" # the subpath of your site, e.g. "/blog" leave blank if no subpath

# Site Author
author:
  name                   : "Mighil" # appears in the footer and atom feed

Disqus

To activate Disqus, fill in your disqus shortname:

comments                 : true # set it to false to disable comments
disqus:
  shortname              : your_shortname

Google analytics

Enable google analytics by filling in your tracking ID:

analytics:
  google:
    tracking_id          : # add your google tracking id here

Collections

If you are using collections, be sure to replace this with your collection name:

collections:
  poetry:
    output: true
    permalink: /:collection/:title/

Pagination

Currently, pagination is set to a the blog page. Unfortunately Jekyll does not yet support pagination on multiple pages.

If you want to paginate on a different page, simply change the  paginate_path value in the config file and create the relevant page.

paginate: 5 # amount of posts to show
paginate_path: "/blog/page:num/"
timezone: # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Navigation

You can change the navigation links in  _data/navigation.yml.

Front matter defaults

At the bottom of the config file, you can also set front matter defaults so that you don’t have to repeat the same front matter for every post. This is an example:

# Front matter defaults
defaults:
  # _pages
  - scope:
      path: ""
      type: pages
    values:
      layout: page
      comments: false
  # _posts
  - scope:
      path: ""
      type: posts
    values:
      layout: post
      comments: true
      share: true
  # _poetry
  - scope:
      path: ""
      type: poetry
    values:
      layout: post
      share: false

How tags work

You should create specific .md files within  /tag/ before using the variable.

Other Stuff

To enhance SEO, you can add your twitter username to  _config.yml.

You can also add an image path for the  og_image value in the config file, for a default open graph sharing image. This value can be overridden in individual posts by using headerimage variable.

Your default image Netlify CMS uploads will go to /images/.

For the various config options see the sample config file for the demo site

The color schemes and fonts can also be customized through scss, by editing the relevant variable in  _variables.scss.

Getting Started on Netlify CMS

Visit this page to read the SparrowX documentation for Netlify CMS.

  • Create a Netlify account if you don’t have one.
  • Fork SparrowX. (No need enable GitHub pages since we’ll be using Netlify CMS to fetch, build the repo and point the domain.)
  • Visit https://app.netlify.com/ and click “New site from Git”

Netlify deploy settings for SparrowX

  • Select  master branch to deploy. Use  jekyll build build command and set the Publish directory as  _site.

Netlify deploy settings for Jekyll

/admin/ directory explained

The /admin/ directory contains the  index.html and  config.yml for Netlify CMS.

Here’s how the  config.yml looks for now.

backend:
name: git-gateway
branch: master

publish_mode: editorial_workflow

media_folder: "images" # Media files will be stored in the repo under images
public_folder: "/images" # The src attribute for uploaded media will begin with /images

collections:
- name: "post"
label: "Post"
folder: "_posts"
create: true
slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields:
- {label: "Type", name: "type", widget: "hidden", default: "post"}
- {label: "Title", name: "title", widget: "string"}
- {label: "SEO Title", name: "seotitle", widget: "string"}
- {label: "Author", name: "author", widget: "string"}
- {label: "Description", name: "description", widget: "string", required: false}
- {label: "OG Image", name: "headerimage", widget: "string", required: false}
- {label: "Updated Date", name: "updated", widget: "string", required: false}
- {label: "Body", name: "body", widget: "markdown", required: false}
- {label: "Tags", name: "tags", widget: "string"}
- {label: "URL", name: "url", widget: "string"}

- name: "page"
label: "Page"
folder: "_pages"
create: true
slug: ".md"
fields:
- {label: "Type", name: "type", widget: "hidden", default: "page"}
- {label: "Title", name: "title", widget: "string"}
- {label: "SEO Title", name: "seotitle", widget: "string"}
- {label: "Description", name: "description", widget: "string", required: false}
- {label: "URL", name: "url", widget: "string"}
- {label: "Body", name: "body", widget: "markdown", required: false}

You may edit this according to your preference.

The Netlify CMS Dashboard

The dashboard looks the way as configured on  config.yml inside  /admin.

Here are the basics:

Netlify CMS dashboard

Go ahead and test SparrowX if you’ve time. Thanks for reading.

Fix: enter-url-1.xyz Analytics Spam

Fix 99-reasons-for-seo.com Analytics Spam

This blog post is a master guide to block Google Analytics referrer spam. I’ve added various methods to block the referral spam and I’ll update the content accordingly.

You’re here because of the new referral traffic from enter-url-1.xyz, goodname1.xyz, 500-good-starts.xyz, 2-easy.xyz, secret-promotion.com, get-here-web.com, yesgood-now.com, yes-do-now.com, advert-seo.com, advertising-seo.com, ads-seoservices.com, seo-services-ads.com, ads-services-seo.com, ads-seo-manager.com, ai-seo-service.com, fast-seo-links.com, autoseotips.com, wakeupseoconsultant.com, 1-best-seo.com, 9-reasons-for-seo.com, 16-reasons-for-seo.com, local-seo-for-multiple-locations.com, seo-b2b.com, affordable-link-building.com, free-seo-consultation.com, get-seo-help.com, your-seo-promotion.com or its variants are spamming your Google Analytics data. Here’s how to block that single referral domain and related multiple referrers.

Method 1: block referral spam using Google Analytics
Method 2: disable spam in .htaccess (for Apache servers)
Method 3: disable spam in NGINX
Method 4: disable spam using Cloudflare

UPDATES:
10/05/2019: Added enter-url-1.xyz fix.
06/05/2019: Added check-pro1.xyz fix.
24/04/2019: Added goodname1.xyz fix.
18/04/2019: Added 500-good-starts.xyz fix.
04/04/2019: Added 2-easy.xyz fix.
03/30/2019: Added secret-promotion.com fix.
03/19/2019: Added get-here-web.com fix.
03/12/2019: Added yesgood-now.com fix.
03/11/2019: Added yes-do-now.com fix.
03/07/2019: Added one-a-plus.xyz fix.
02/26/2019: Added advert-seo.com fix.
02/25/2019: Added advertising-seo.com fix.
02/19/2019: Added big-seo-deal.com fix.
02/18/2019: Added ads-seoservices.com fix.
02/15/2019: Added seo-services-ads.com fix.
02/13/2019: Added ads-services-seo.com fix.
02/11/2019: Added ads-seo-manager.com fix.
02/08/2019: Added ai-seo-service.com fix.
01/31/2019: Added fast-seo-links.com fix.
01/23/2019: Added autoseotips.com fix.
01/18/2019: Added wakeupseoconsultant.com fix.
01/15/2019: Added bestecommerceseo.com fix.
12/19/1018: Added 1-best-seo.com fix and NGINX method to block the Analytics spam.
12/06/2018: Added 16-reasons-for-seo.com fix.
12/05/2018: Added 15-reasons-for-seo.com fix.
12/04/2018: Added  99-reasons-for-seo.com fix.
12/03/2018: Added  100-reasons-for-seo.com fix.
11/29/2018: Added local-seo-for-multiple-locations.com fix.
11/14/2018: Added seo-b2b.com fix.
11/07/2018: Added affordable-link-building.com fix.
11/01/2018: Added free-seo-consultation.com fix.
10/27/2018: Added get-seo-help.com fix.
10/13/2018: Added the solution to fix seo-services-with-results.com Analytics spam
10/10/2018: Added the solution to fix better-seo-promotion.com spam.
09/27/2018 11:57 PM: Blimey! It seems like they’re targeting me for writing this blog post.
09/27/2018 11:16 PM: Added the Cloudflare method to block servers that spam your website.
09/25/2018: This guide has the solution to fix your-seo-promotion-service.com-spam, my-seo-promotion-service.com, and other domains that spam Google Analytics. Just change the domain name/URL accordingly. I’ve added a new .htaccess method also (future-proof).

Exclude a single referrer

How to Block your-seo-promotion.com Analytics Spam (September 2018)

  1. Sign in to Google Analytics.
  2. Click Admin, and navigate to the view in which you want to create the filter.
  3. In the VIEW column, click Filters.
  4. Click + New Filter. (If you can’t see this button, you do not have the necessary permission.)
  5. Select Create new Filter.
  6. Enter a name for the filter. Let’s name it enter-url-1.xyz.
  7. Set the Filter Type to Custom.
  8. Click the Select filter type drop-down menu and select Exclude.
  9. Now Set the Filter field to Campaign Source.
  10. Enter the Filter Pattern. In this case, add enter-url-1.xyz (the-spam-domain-name.tld) and click Save.

To Exclude multiple referrers

You can use the regular expression in the Filter Pattern field to exclude several referring sources.

i.e., If you want to add multiple URLs, make a filter pattern separated by a | (pipeline).

Example:

otherspammysite\.com|*enter-url-1\.xyz

Visit this link to learn more about setting filters on different levels. You may also set the Language Settings Filter and Campaign Referral Path Filter as well.

Block Analytics Spam in .htaccess

Applying filters is more like a band-aid solution. The spam sites are still sending traffic to your website, and GA doesn’t show it. Want to block the referral sites before they get to your site? There are two methods to block referral spam using .htaccess.

1. The Easy Method

You have to be careful when editing .htaccess files, as a small mistake can make your website stop working or throw a server error loop. So have a backup! Copy and paste the old content of .htaccess file somewhere safe before proceeding.

Usually, the .htaccess file goes to the root of your website (/public_html for example, the same location of wp-config.php). If there is none, you can create a new file. But watch out not to create something like “.htaccess.txt” if you do it with notepad (which usually appends .txt to all files).

The location may vary according to where you installed WordPress inside the host. Edit the .htaccess file and add the following line:

# BLOCK ANALYTICS SPAM
RewriteEngine on
RewriteCond %{HTTP_REFERER} enter-url-1\.xyz [NC, OR]
RewriteCond %{HTTP_REFERER} wakeupseoconsultant\.com [NC, OR]
RewriteCond %{HTTP_REFERER} example-spam-website\.com [NC]
RewriteRule .* - [F]

(Copy and paste the code in the bottom of your .htaccess.)

Note: Check whether a RewriteEngine On line is already inside your .htaccess file. Then you don’t need to copy that particular line from the code I shared. RewriteEngine only needs to occur once in the file, preferably at the top.

2. Find Spam Site’s Server IP Address & Block it

There are chances the spammer may spin up more domain names for this unholy practice. Solution? Deny their server to access your website. Proceed at your own risk.

GeneratePress Review: Best Gutenberg-ready Theme

Use a DNS lookup tool like mxtoolbox.com to check spam domain’s (enter-url-1.xyz in your case) IP address:

Find your-seo-promotion.com's Server IP Address

As you can see, 217.23.10.44 turns out to the unique IP of the domain.

However, you’ve to make sure the spammer is not using any CDN to hide their IP address. Look at Facebook.com for example:

Facebook CDN

Facebook, Inc. CDN uses specific IP ranges for delivering Facebook.com. Here’s a list of IP Ranges that Cloudflare use. Make sure that you identify the unique IP of spammer and not IP ranges of a CDN service.

Upon identifying the spam sever, edit the .htaccess file and add the following line:

# block spam referrer
Deny from 217.23.10.44

Make sure that you enter the correct IP address. Doing so will block all the spammy domains pointed to this server IP address.

Block Analytics Spam Using in NGINX

Open your nginx.conf file located in /etc/nginx/nginx.conf

Proceed at your own risk. Contact your host to confirm the location of nginx.conf file. Make sure you have root access to the host. Always have a backup! Copy and paste the old content of nginx.conf file somewhere safe before proceeding.

Add the following lines inside the http block:

# Referer spam

map $http_referer $spam_referer {
default 0;
include /etc/nginx/spam_referer.map;
}

Nginx’s map (ref) module lets you create variables in Nginx’s configuration file whose values are conditional — that is, they depend on other variables’ values. The map command can only be used inside of the http block.

Create An Analytics Spammer List

Create a new file in the NGINX root directory (‘/etc/nginx’) and name it ‘spam_referer.map’ to save a list of spam referrers:

"~*enter-url-1.xyz" 1;
"~*wakeupseoconsultant.com" 1;
"~*free-social-buttons.com" 1;
"~*15-reasons-for-seo.com" 1;
"~*99-reasons-for-seo.com" 1;
"~*another-example-spam-website.com" 1;

The “~*” means case-insensitive matching.

Now open /etc/nginx/sites_available/default and add the following lines to the server block:

# Referrer exclusions

if ($spam_referer) {
return 444;
}

444 Explained: Connection Closed Without Response is a non-standard status code used to instruct nginx to close the connection without sending a response to the client, most commonly used to deny malicious or malformed requests. This status code is not seen by the client, it only appears in nginx log files.

Verify & Restart Nginx Service

Run this command to verify the config:

nginx t

Restart nginx if the test is successful:

sudo service nginx restart

Block IPs in Cloudflare CDN

Cloudflare user? The Firewall tab on Cloudflare provides you with an interface that you can use to block or whitelist IP addresses or entire networks. Based on the results from mxtoolbox.com, you can block spammer’s IP using Cloudflare. Here’s how to do it:

  1. Log in to Cloudflare.
  2. Go to the Firewall app.
  3. Add an entry to the Access Rules and select the action.
As seen on support.cloudflare.com.

Good luck!

Help someone else by sharing this article. Thank you.

Need a hand?

Need help optimizing your website analytics, speed and search performance? Connect with me now.

Cloudways: An Honest Review

Cloudways Discount Coupon Code & Offers: 100% Honest Review (2018)

Update: Exclusive Cloudways Coupon Code 2018 – FLAT 20% off!!

Image result for good news everyone

One more reason to start or migrate your WordPress site to Cloudways. I’ve teamed up with Cloudways to bring you an excellent and exclusive deal.


Use the coupon code “MIGHIL” to get a FLAT 20% discount on the first invoice. Offer applies to all plans.


This one’s a killer Cloudways promo code if you’re selecting a small or medium-sized server to host your WordPress site.

Click here to sign-up & use the promo code MIGHIL.

This Cloudways promo powered by Mighil.com is a limited time offer valid for three months starting from September 19, 2018. Hurry up and take advantage of the best Cloudways coupon for 2019.

How to use the Cloudways Coupon Code

Mighil.com’s exclusive Cloudways coupon code gives you FLAT 20% off on your first invoice independent of the servers you choose. Follow the instructions below to redeem the coupon code and get a fair discount while signing up with Cloudways.

Visit this link to land on the Cloudways sign-up page.

Cloudways Discount 2018
Click on Get Started Free and it’ll lead you to the sign-up form.

Now click on “Got a Promo Code” and fill in MIGHIL

Cloudways Promo Code 2018 Exclusive

Cloudways: An Honest Review by Mighil

New to Cloudways managed cloud web hosting platform? Not sure if it’s the best choice for managing your WordPress site(s)? Read this blog post before investing your time and money on Cloudways.

TLDR; Yes, it is one of the best WordPress hosting platforms. Read the backstory, will you? Then we’ll jump to the review.

Backstory

I’m very picky but straightforward when it comes to recommending stuff to friends and peers. I’ve tested a handful of dedicated Cloud hosting (VPS) services to date. I’ve been a DigitalOcean user for years before switching to BandWagonHOST and NameCheap hosting.

In love with BandWagonHOST

BandWagonHOST is quite cheap, and they provide OpenVZ & KiwiVM based plans. The downside? You need to have intermediate skills in managing virtual private servers. It’s not for the faint-hearted. I loved every bit of managing own server and setting up multiple WordPress sites on BandWagonHOST. It was fun while it lasted.

Leaving BandWagonHOST for NameCheap

I left BandWagonHOST just because the servers were getting slow for the mainland Chinese audience. I hosted a few projects for Chinese clients on BHW, but the performance got worse (even with a Cloudflare CDN). Things were going south, and I needed a quick solution. NameCheap came to the rescue, temporarily. Quite frankly, cPanel isn’t my thing, so I left NameCheap in a few days and got a 100% refund.

Leaving NameCheap for CloudWays

I visited my hometown in India last June for work related reason. Anvar at Mozilor suggested Cloudways and said they’re using Cloudways for years. I never thought of giving it a try since I was quite happy with my highly flexible BandWagonHOST server during that time.

His suggestion came on my mind while researching for a new host. Signed up and tested their service, really liked it, and now I’m with Cloudways.

Cloudways Platform, A Brief Introduction

What is CloudWays?

Unlike the widely used consumer-friendly options like Bluehost, HostGator or Siteground, Cloudways adds the DIY touch to the WordPress hosting scene by bringing together an innovative, scalable, budget-friendly managed hosting platform with rich features and 24x7x365 support. Their newly redesigned website looks sleek and comes with a neat UI.

CloudWays Features

With Cloudways, you can spin up “pay as you go” servers based on DigitalOcean, Vultr, Linode, Amazon AWS or Google Cloud Platform. Apart from that, Cloudways platform comes with handy performance-boosting technologies, including PHP7, Nginx, Redis, Memcached, Varnish, HTTP/2 and add-ons like DNS Made Easy, Rackspace Email, Elastic Email, CloudwaysCDN and more.

Cloudways Pricing

CloudWays Pricing

As you can see, Cloudways is a “Pay As You Go” platform; meaning, you will pay only for the resources you consume. You can either bind a credit card to automate the billing or use PayPal to add funds.

Base Packages

  • DigitalOcean – Starting at $10/month.
  • Linode – Starting at $12/month.
  • Vultr – Starting at $11/month.
  • Google Compute Engine – Starting at $34.17/month.
  • Amazon Web Service – Starting at $36.04/month.

Build A WP Site With Cloudways

3-Day Free Trial

You can Get Started for FREE using a valid email ID or with LinkedIn, GitHub or Google+ accounts. Keep in mind that they’ll ask for a working phone number (not a VoIP or Google Voice number) during registration. Also, note that you have to initiate a chat with customer support to start your 3-day free trial without a credit card.

Cloudways Activation

It took about 15 minutes for Cloudways to review my account. Here’s the screenshot of the conversation I had with Zeeshan at Cloudways.

Cloudways Chat

The customer support team will ask you to provide the email ID and website URL (not mandatory) for initial review. Later, they will send you a confirmation email to activate the account.

CloudWays Activation Email

The whole process was smooth, and you can create a new WordPress application right away for testing. “Need a Hand” button on the right side will open Help Center, which will be a goldmine for beginners to managed hosting.

CloudWays Start New Server

Click LAUNCH NOW after choosing the application and server details.

Why Choose Cloudways for WordPress

The Cloudways platform assures high-speed performance, managed security and expert support.

Above mentioned are the essential factors to look for when you’re purchasing a managed hosting service. Let’s look at the key features.

Server Speed & Performance

I have experience managing servers at a root level. Even though Cloudways doesn’t provide root access, they offer a wide array of performance boosters essential for WordPress applications.

Cloudways High-Speed Performance WordPress

Built-in Advanced Caches

Cloudways provide an optimized stack with ready to use caches including Memcached, Varnish, Nginx, and Redis to deliver expedited responses.

PHP 7 Ready Servers

All Cloudways server are PHP 7.x ready, which is known to be significantly faster than its predecessor.

Cloudways also give you the option to Control Core Services that allow your application(s) to run. You can optimize it now and then if you know what you’re doing.

CloudwaysCDN (New)

Cloudways Add-ons

Cloudways platform now comes with CloudwaysCDN, a new powerful and straightforward service that delivers superior performance and excellent global response times.

It can be integrated quickly and will significantly improve the speed of your WordPress website.

Auto-Healing Managed Cloud Servers

Auto-healing lessens your worries about website crashing or downtime. Cloudways is equipped with auto-healing and comes to site’s rescue.

Free WordPress Cache Plugin

Breeze by Cloudflare

Breeze; the WordPress plugin engineered by Cloudways team offers better WordPress performance boosting comparing to other cache and performance plugins.

Breeze WordPress plugin comes pre-installed on Cloudways.

Redis Support

Enabling Redis improves the performance of databases. Combined with Apache, Nginx, and Varnish; you’re looking at unbeatable performance.

Pre-configured PHP-FPM

PHP-FPM speeds up your website and improves the loading times of your PHP environment.

HTTP/2 Supported Servers (New)

Cloudways servers are HTTP/2 enabled which significantly increases the speed of communication between the web servers and clients.

Managed Security

Security is essential even if you are running a personal website or a professional blog that attracts a fair amount of traffic.

Cloudways platform is equipped with security practices to keep your servers safe.

Dedicated Firewalls

According to the Cloudways, all servers hosted by Cloudways are protected by OS-level firewalls that filter out malicious traffic and keep out the intruders.

1-Click Free SSL Installation

Cloudways platform comes with built-in Let’s Encrypt SSL. It also lets you add your SSL certificates easily with few clicks.

Get A 3-Days Trial for Cloudways

IP Whitelisting

The Cloudways platform lets you create a whitelist of IPs, making it easy to collaborate with networks or regions with unrestricted access to SSH and SFTP.

Regular Security Patching

Cloudflare claims they perform regular OS patches and firmware upgrades on servers. Security patches ensure a robust managed cloud server experience by avoiding vulnerabilities.

Two-Factor Authentication

Two-Factor Authentication (TFA)  adds an extra layer of safety to your Cloudways account.

Adding A WordPress Application

Adding a WordPress application is pretty straightforward on Cloudways.

Visit https://platform.cloudways.com/apps and click on + Add Application button to add a new app to the server.

Cloudways Console

You can set a primary domain, install Let’s Encrypt SSL certificate (including wildcard SSL) and optimize the site afterward. This console is pretty intuitive.

Migrate a Cloudflare-enabled site to Cloudways

Backup, Clone/Staging and Migration

Backup

Cloudways Backup

You can perform an on-demand backup of your server via the console. Cloudways console also has an option to enable Local Backups; this will additionally create a downloadable copy of all the applications present on your server.

Clone App/Create Staging

Cloudways Staging Feature

Cloning/staging is a great beta feature Cloudways providing for its community. Cloudways lets you create staging apps and move data between staging and live applications.

Migration

Cloudways provides a decent migration tool to move the site from your old host to Cloudways platform. I’ve already written an article on this topic. You can read it here if you’re planning to migrate a website with SSL enabled.

Cloudways WordPress Migrator

Download CloudWays WordPress Migrator

Server and App Monitoring

Cloudways Server Monitoring

Cloudways provides performance graphs on various aspects of your server. They have partnered with Newrelic to offer built-in App Monitoring as well.

You can enable New Relic agent in the Services section of the console.

Customer Support

Yes, support should be a priority while choosing a cloud platform for WordPress. You don’t want to end up in the hands of a service provider that doesn’t respond to your queries and concerns promptly.

Cloudways customer support team are the best, period. You can talk to the Customer Success Team via live chat, or submit a ticket through the ticketing system. They’ve recently launched a community website as well.

You can access it here: https://community.cloudways.com/

Their Knowlege Base is well-documented also. Most articles are beginner friendly and reminded me that of NameCheap’s KB articles.

Frequently Asked Questions

How good is Cloudways support?

Their Live Chat Support Team is available 24/7/365 for everyone. You can also create a Support Ticket. If you are an enterprise customer, you may contact [email protected]

Do I need a credit card to sign up for a free trial?

No. A credit card is not required. However, you’d only have three days to test the platform.

Can I have servers on separate pricing plans and different cloud providers?

Yes, you can launch multiple servers of the same or different cloud hosting plans and providers. It is entirely up to you.

How many applications can I launch on a single server

There is no restriction on the number of apps you can start on a single server.  However, plan well according to your server specifications.

What if I exceed my bandwidth?

Bandwidth is calculated based on the provider you select.

  • On Amazon and Google servers, bandwidth billing is on demand at all times.
  • Vultr charges $0.02 to $0.05 per GB for additional bandwidth usage (varies with data center region).
  • DigitalOcean charges $0.02 per GB for additional bandwidth usage.

How to cancel Cloudways account?

Cloudways is a “Pay as you go” platform. You can cancel the account by deleting your servers anytime, and you only need to pay for what you’ve used.

Verdict

I am familiar with DigitalOcean, and I love using Cloudways as a platform because it’s flexible and transparent. I can add my clients for billing and even add team members for collaboration.

The platform is quite intuitive so that I can teach my clients’ very basic stuff without taking 100% responsibility for the project.

Cloudways is ideal for professional bloggers and small to medium-sized companies as well. If you are skeptical, go ahead and test the platform for three days.

Goodluck!

Get Started With Cloudways for FREE!

Radio (China-only)

What's faster than a VPN?

Use SocketPro. Best VPN alternative for expats in China. Just $2.41/m.

Set up a fast website in China

Hire me. I provide top-notch website optimization services for China.

Other Links

Free DigitalOcean CreditCheap VPS HostingSet up a blog in ChinaExpat life in ChengduSpeed up website for ChinaBest VPNs for ChinaHackintosh Journal Sponsor or Donate to Mighil.com.

© 2020 Site Notice. Powered by DigitalOcean & GP.