Set Up Your Blog for On-Page SEO

Search engine optimization is a huge topic and one that we’ll dissect throughout this book. You won’t need to become an expert, but possessing a solid understanding of the essential notions will have a significant impact on your blog’s efforts to attract an audience. This is a key challenge for bloggers.

SEO techniques can be roughly divided into two categories: on-page SEO and off-page SEO. On-page SEO is what you do on your site to ensure that the content you present is properly evaluated and classified by search engine bots (also known as spiders or crawlers). For example, we’ve already seen how having, say, /better-python-errors as your permalink instead of /?p=123 ensures that search engines have a better understanding of what your post is about and which keywords are relevant to your post. That’s part of our on-page SEO efforts.

Off-page SEO is what you do to increase the value of your content outside your own site: for example, link-building efforts, or managing to get backlinks from other sites on the web. You guessed it, we’ll thoroughly discuss this topic as well.

We’ve already covered the importance of SEO-friendly permalinks. What else is there for on-page SEO? Much of what needs to be done for on-page SEO is specific to posts you create, so it’s best explained when discussing the subject of your site’s content, which we’ll do in the next chapter.

As far as the initial setup for on-page SEO goes, there are only three remaining steps we need to take care of:

  1. Generating an XML site map for our posts and pages
  2. Adding our blog (and sitemaps) to Google Search Console
  3. Ensuring our blog is fast and responsive (i.e., it renders well on mobile devices)

Generate an XML Sitemap

Sitemaps are XML representations of the structure of your site. As the name implies, they’re literally maps of your site that list every page and post within it. They help search engines properly crawl and discover all of your content.

Your first step is to generate an XML sitemap that’s automatically updated every time you post a new article or make some changes to the location of your content. This is blog-engine specific, but most platforms either have a built-in option (like Ghost does at /sitemap.xml), or they provide some form of plugin to accomplish this (e.g., the jekyll-sitemap plugin). If all else fails, searching for <blog engine name> sitemap in Google should yield some tutorials on how to accomplish this task.

If you’re using WordPress and have installed Yoast SEO, you’re in luck as well. Just check the Features tab to ensure the option has been enabled during the initial setup of the plugin. You can find a list of sitemaps it’s generated by appending /sitemap_index.xml to your blog URL. The following figure shows the Yoast SEO’s generated sitemaps for my programming blog.

images/yoast_seo_sitemaps.png

Figure 10. Sitemaps generated by Yoast SEO

The ones you’ll want to pay attention to, in the case of Yoast SEO, are /post-sitemap.xml and /page-sitemap.xml. In the unlikely event that your blog already has hundreds of posts, you might find more than one XML file for your posts (e.g., /post-sitemap1.xml, /post-sitemap2.xml, etc.) Before a much-needed pruning, https://anynewbooks.com, my new book notification service, whose front-end uses WordPress, had over 17,000 posts, so many sitemaps were automatically generated for its posts.

Blogger users will also have sitemaps automatically, at /sitemap.xml and /sitemap-pages.xml for posts and pages, respectively.

Add Your Blog to Google Search Console

Google Search Console (available at https://google.com/webmasters/tools/ and formerly known as Google Webmaster Tools) is a tool for webmasters that allows you to take a peek behind the curtain of how Google sees your site (specifically how your site should be crawled and presented by Google). It can inform you of indexing problems. For example, if you change the structure of your URLs but forget to set up proper HTTP 301 redirects, Google Search Console will alert you that you now have many broken links (also known as 404 links).

Sign up with the tool and add your blog. You’ll want to add your site and all of its variations. For example, for programmingzen.com I created the following four variations, even though they all redirect to my main URL, which is https://programmingzen.com:

  1. http://programmingzen.com
  2. http://www.programmingzen.com
  3. https://programmingzen.com
  4. https://www.programmingzen.com

This will allow you to catch any problems, including possible domain redirect issues in the future. Google also allows you to specify a preferred domain name, among the available variations, in Site Settings. Our selection will determine how the domain is presented to the users in the search engine result pages (SERP).

images/google_search_console_site_settings.png

Figure 11. Setting the preferred domain name in the Google Search Console

When you add each variation of your blog URL, Google will ask you to verify your ownership of the site and offer you several ways to do that, including altering your DNS records and embedding a special meta tag in the header of your blog. To take full advantage of what Search Console has to offer, verify the URLs by choosing the verification method that’s most convenient for you.

Google Search Console really is a set of invaluable tools that help you to better understand how Google views your blog. Among this tool’s many features, you’ll be able to diagnose if your site is being properly crawled, which keywords Google thinks are relevant to your blog, what sites link to you, if there are security issues, whether Google has any suggestions for you, and much more.

If you were to ever rename your blog’s domain, Search Console will also enable you to inform Google of your change of address (but you’ll need to set up the HTTP 301 redirects yourself). Keep in mind that changing your domain name once your domain is already established is generally a bad idea and should be considered only as a last resort.

I invite you to spend some time on your own exploring the many features available in Search Console. Right now, however, we’re concerned with adding our blog sitemap(s) to the tool for optimal discoverability.

You can do so by finding the Sitemaps section (currently located under the Crawl section) in Search Console. Here you can add your posts and pages sitemaps if your blog engine organizes them in two different sitemaps. Alternatively, you can submit your index of sitemaps generated by plugins like Yoast SEO (again, located at /sitemap_index.xml), and Google is smart enough to process the information within. This section of the Search Console will also show you information about how many pages and images have been submitted and indexed.

Speaking of Yoast SEO, if you are using the plugin, it’s a good idea to connect your Search Console in the Webmaster Tools tab. This way you’ll be able to receive notifications from Google Search Console directly from within the plugin for a single-point, seamless experience.

It’s worth noting that equivalent webmaster tools to the Search Console exist for other search engines. Bing has one, for example.[45] Perhaps more interestingly, Yandex and Baidu do as well, and you should absolutely add your site if you are blogging in Russian or Chinese, respectively. (And Yoast SEO allows you to connect all of these alternative tools as well in their Webmaster Tools section.)

Performance Considerations

Many good things can be said about WordPress, but speed isn’t one them. A default installation connects to the database and dynamically generates content with each request, thus becoming quite demanding on your server’s resources.

When you first start blogging, your main challenge is to attract eyeballs, so a slow CMS may not be a huge deal initially. However, by following the roadmap that I’ve outlined in this book, you may manage to attract hundreds or thousands of visitors in the span of a few hours upon publishing—even in your early days as a blogger.

A vanilla WordPress installation will most likely die under the weight of so many requests, and you certainly don’t want to see your site become unresponsive when so many people are eager to read what you’ve written—what an unattractive, if not uncommon, first impression that would be!

If that’s not enough to make you consider the consequences of speed (or lack thereof), consider this: Google is increasingly punishing sites that are slow to load (as well as sites that are not responsive, meaning that they don’t render properly on mobile devices) in its result pages.[46] So let’s see what we can do to help prevent this situation.

Recipe 19Ensure your theme is responsive.

Depending on the blog engine you’re using and how your site is hosted, some or all of these points about performance may not apply to you. However, it won’t hurt to read them anyway.

Cache Everything

Server side, if you have control over your server, feel free to optimize the optimizable. Use Nginx instead of Apache, and configure Nginx, PHP, and MySQL to make them speedier than their default configurations (if you’re not an expert on these already, you may have to do some Googling and experimentation). More importantly, however, you must install a caching plugin if you are using WordPress. We discussed some recommendations in the previous chapter. If you haven’t installed one, please go back and install it now.

Even on shared hosting, a properly cached WordPress installation can handle thousands of visitors. The magic of caching lies in its ability to serve static versions of dynamically generated pages. Once a cached version of a page has been generated, the performance levels aren’t far off from those of a static HTML page.

Just ensure you enable caching in the configuration settings of the plugin you installed. Some will be installed with the caching option off by default. Depending on which one you chose, you’ll also have different options to speed up your site further, such as compressing your pages with gzip, grouping multiple JavaScript and CSS files into one .js and .css minified file each to reduce the size and number of requests your pages make upon loading, and so on. In general, you’ll want to play a little with these options to see what leads to optimal loading times without breaking your theme.

You may also want to look into what options are available in your blog engine for CDNs (content delivery networks). These can greatly improve performance when serving static content such as images, JavaScript, and CSS files. CDN services are not generally free, but they can be quite affordable. (WordPress users can enable the free image CDN service provided by the Jetpack plugin.)

Recipe 20Use a CDN to speed up your blog.

Every modern browser offers development tools that you can use to test how the changes you make affect the loading times for your blog, but you might find specialized tools and services to provide a much better experience, along with some insightful recommendations. Two tools worth considering are PageSpeed Insights by Google or the even more informative (and my favorite) GTmetrix.[47]

Jetpack for WordPress offers uptime monitoring that informs you when your site becomes unavailable. If you’re not using WordPress, you might want to add your site to one of the many uptime monitoring services available. Uptime Robot and Pingdom are two popular options.[48]

What About AMP pages?

Accelerated Mobile Pages (AMP) is a technology that, by leveraging some constraints on what can be included in a page, allows for lightweight, fast-loading pages on mobile devices, where users are more likely to expect immediate answers. In theory, this is great. In fact, these pages are promoted by Google in a Top Stories carousel or otherwise rewards them with higher mobile ranking. That’s why when you search on your smartphone, you’ll often see a bolt icon next to top results. Those are AMP pages (yes, Accelerated Mobile Pages pages).

In practice, it’s a little more complicated than that. You now have two different versions of your page, a canonical one and an AMP one, that need to be substantially similar. There are some issues related to branding, navigation, analytics, Google providing users with their own cached version to further improve speed, and more. All in all, it’s a bit of a headache at the moment, even if you use a plugin for WordPress that simplifies their creation. My recommendation is to ignore AMP pages for now and consider them at a later stage, when you’ll have more experience with blogging and will be able to decide whether the benefits are worth it to you and your site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset