<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Dwarkanath Prabhu</title>
    <description>The latest articles on Forem by Dwarkanath Prabhu (@pdwarkanath).</description>
    <link>https://forem.com/pdwarkanath</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F228520%2F78819683-8cbd-437f-ae0d-8542541c5cbb.jpeg</url>
      <title>Forem: Dwarkanath Prabhu</title>
      <link>https://forem.com/pdwarkanath</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pdwarkanath"/>
    <language>en</language>
    <item>
      <title>The why of SEO</title>
      <dc:creator>Dwarkanath Prabhu</dc:creator>
      <pubDate>Tue, 17 Sep 2019 04:32:05 +0000</pubDate>
      <link>https://forem.com/pdwarkanath/the-why-of-seo-377h</link>
      <guid>https://forem.com/pdwarkanath/the-why-of-seo-377h</guid>
      <description>&lt;p&gt;Every year, the big bloggers publish articles on how to do SEO in that year. It's usually good advice but I feel like there's a lot of focus on "what" rather than "why". Like, "have relevant H1 and title tags because Google considers them in its ranking algorithm". But why does Google consider them important at all? I do not intend to diss any SEO experts, just trying to explain why they suggest the tips or 'hacks' they suggest.&lt;/p&gt;

&lt;p&gt;If Google changes its algorithm tomorrow, a lot of such hacks would stop working. But if you know why Google gives importance to certain factors over others, you can stop worrying about algo updates altogether.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Google wants
&lt;/h2&gt;

&lt;p&gt;What Google wants is to give its users the best experience. Now what do users want when they use Google to search for something. They want results that are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relevant&lt;/li&gt;
&lt;li&gt;Quick&lt;/li&gt;
&lt;li&gt;Readable / accessible&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the webpage you want to rank for a certain keyword matches all these criteria, then the only thing left for you to do is to make it easy for Google to index your site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick and readable
&lt;/h2&gt;

&lt;p&gt;Quick and readable are fairly straightforward - your site needs to load fast. Some ways to do that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimize calls to external scripts (plugins)&lt;/li&gt;
&lt;li&gt;Compress (optimize) images&lt;/li&gt;
&lt;li&gt;use CDN to deliver media like images&lt;/li&gt;
&lt;li&gt;Minify CSS, JS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For readability, you will need to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make the site responsive - i.e. adjust font sizes and alignment according to device screen size&lt;/li&gt;
&lt;li&gt;Avoid popups&lt;/li&gt;
&lt;li&gt;minimize ads&lt;/li&gt;
&lt;li&gt;make the site screen reader friendly (for blind people) - alt tags, contextual anchor text, nested headings (h1, h2) etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Relevance that you can control
&lt;/h2&gt;

&lt;p&gt;For relevance, you cannot control everything. Eg. You cannot control whether a user clicks on your link in search results or not. What you can do is think from a user's point of view.&lt;/p&gt;

&lt;p&gt;If you are a user of a search engine, when you type in a keyword, what do you look for in search results? You see the title, the URL, the description. You judge based on these 3 which one you want to click on.&lt;/p&gt;

&lt;p&gt;So, as a blogger, you can make these 3 things include the keyword you want to rank for. This is entirely in your control.&lt;/p&gt;

&lt;p&gt;It's not over yet... Your content has to live up to a user's expectation. &lt;/p&gt;

&lt;p&gt;Eg. Let's say you have a travel blog and you wrote about your trip to Yellowstone National Park. You want to rank for "camping in Yellowstone" and you include it in the title, URL, h1 etc but the content just has pictures and no information on how to get there, what to see, where to go etc. A user comes to your site and quickly closes the tab. Now this increases your bounce rate. This is taken by Google to mean your site wasn't the most relevant search result for that user. If it happens to often, your site will slowly move down the rankings. &lt;/p&gt;

&lt;p&gt;So unless you write good content that actually answers the questions a user has when they search for a particular keyword, you will not rank on Google, or at least won't stay near the top of rankings. &lt;/p&gt;

&lt;h2&gt;
  
  
  Get indexed
&lt;/h2&gt;

&lt;p&gt;Finally let Google know that you exist:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Register on search console and submit a sitemap&lt;/li&gt;
&lt;li&gt;If you are a local business, register on Google My Business  and add your hours, contact, address etc&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusions and Summary
&lt;/h2&gt;

&lt;p&gt;If you can think from a user's perspective, you can anticipate algorithm changes before they happen. Eg. In the last 5-6 years, the importance of mobile usability has increased in Google's search algorithm. If you already knew that a large section of your users came from mobile devices, you would have made your site mobile readable long before Google could update its algorithm.&lt;/p&gt;

&lt;p&gt;To summarize, instead of implementing some hacks an SEO expert told you, try to create the best experience for your users and make it easy for search engines to index your site. That should take care of SEO without any worry of penalties.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DISCLAIMER:&lt;/strong&gt; By no means am I saying this is an exhaustive list of things to do. I'm just trying to show how you should think about SEO, at least the parts you can control completely. Like guest posting, for example, depends heavily on which blog you post to and whether they agree at all.&lt;/p&gt;

&lt;p&gt;I posted this on reddit a few weeks back&lt;/p&gt;

</description>
      <category>seo</category>
      <category>blogging</category>
    </item>
    <item>
      <title>Adding Structured Data to your Hugo site</title>
      <dc:creator>Dwarkanath Prabhu</dc:creator>
      <pubDate>Thu, 12 Sep 2019 16:52:55 +0000</pubDate>
      <link>https://forem.com/pdwarkanath/adding-structured-data-to-your-hugo-site-58db</link>
      <guid>https://forem.com/pdwarkanath/adding-structured-data-to-your-hugo-site-58db</guid>
      <description>&lt;p&gt;If  you search for a popular topic on Google, you can see some news articles displayed prominently at the top of Google Search Results. Like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fi5dtg7ldl584gvb12nj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fi5dtg7ldl584gvb12nj0.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google recognizes that a certain page on the web is an article and more specifically an article related to the topic you searched because the publisher (like Times of India in this case) has added structured data to their pages. Structured Data is a set of rules to inform search engines what a particular page on your website is all about.&lt;/p&gt;

&lt;p&gt;There are some obvious benefits to adding Structured Data to your website. You can see above that articles with structured data look different from normal search results i.e. there is a publisher name (like Times of India), thumbnail image, summary etc. They take up more space than normal search results and more importantly, these results are featured on top of search results giving them maximum visibility. More visibility in search results means more clicks and traffic to your website.&lt;/p&gt;

&lt;p&gt;If you have a blog, your posts will be of the type "Article" or "BlogPosting". The necessary structured data Google needs for an article is mentioned on their website here: &lt;a href="https://developers.google.com/search/docs/data-types/article" rel="noopener noreferrer"&gt;https://developers.google.com/search/docs/data-types/article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The complete list of rules (for all kinds of pages) can be found on the official Schema documentation website: &lt;a href="https://schema.org/docs/full.html" rel="noopener noreferrer"&gt;https://schema.org/docs/full.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, writing structured data for every page on your website is tedious especially if each page is about a different topic. Fortunately, static site generators allow you to create your own &lt;code&gt;partials&lt;/code&gt; i.e. pieces of HTML code that are repeated across the site. By allowing some variables in partials, it is possible to have unique schema for all of your pages. Follow the steps below to do exactly this.&lt;/p&gt;

&lt;h2&gt;
  
  
  Crate a &lt;code&gt;schema.html&lt;/code&gt; file
&lt;/h2&gt;

&lt;p&gt;If you have a static site built using Hugo, all you need to do is create a partial called &lt;code&gt;schema.html&lt;/code&gt;. Google recommends you write the structured data in JSON-LD. You don't need to know much about JSON-LD. Just copy the code snippets below as they are and you're golden 😛&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script type="application/ld+json"&amp;gt;
{{ if eq .Section "posts" }}
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": {{ .Title }},
  "image": {{ .Params.featuredImage | absURL }},
  "datePublished": {{ .PublishDate }},
  "dateModified": {{ .Lastmod }},
  "author": {
    "@type": "Person",
    "name": {{ .Site.Params.author }}
  },
  "mainEntityOfPage": { "@type": "WebPage" },
   "publisher": {
    "@type": "Organization",
    "name": {{ .Site.Params.header }},
    "logo": {
      "@type": "ImageObject",
      "url": {{ .Site.Params.logo }}
    }
  },
  "description": {{ .Summary | plainify | safeHTML }},
  "keywords": [{{ range $i, $e := .Params.tags }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}]
}
{{ end }}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": {{ .Site.Params.header }},
  "url": {{ .Site.BaseURL }},
  "sameAs": [
    "https://www.facebook.com/{{ .Site.Params.facebook }}",
    "https://www.instagram.com/{{ .Site.Params.instagram }}",
    "https://twitter.com/{{ .Site.Params.twitter }}",
    "https://github.com/{{ .Site.Params.github }}"
  ]
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file needs to be in your theme's &lt;code&gt;partials&lt;/code&gt; folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add variable values to &lt;code&gt;config&lt;/code&gt; file
&lt;/h2&gt;

&lt;p&gt;In your site's config.toml file, you will need to add the values of variables that you have used in &lt;code&gt;schema.html&lt;/code&gt; file above. For my website, &lt;a href="https://weekinmemes.com" rel="noopener noreferrer"&gt;WeekInMemes&lt;/a&gt;, I would use my own name as author, social media handles etc. For your website replace those with your own values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;baseURL = "https://weekinmemes.com"

[params]
author = "DK"
logo = "img/logo.jpg"
header = "Week In Memes"

facebook = "weekinmemes"
twitter = "weekinmemes"
instagram = "weekinmemes"
github = "weekinmemes"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add partial to &lt;code&gt;head&lt;/code&gt; tag
&lt;/h2&gt;

&lt;p&gt;Finally you will need to add this partial somewhere in your &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag. Usually your Hugo theme will have a &lt;code&gt;head.html&lt;/code&gt; partial where you can add the following line before closing the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{{ partial schema.html . }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;p&gt;Once you have all these in place, you can use your regular building commands (&lt;code&gt;hugo -D&lt;/code&gt; or &lt;code&gt;hugo server -D&lt;/code&gt;) to see the HTML files generated.&lt;/p&gt;

&lt;p&gt;Use the &lt;a href="https://search.google.com/structured-data/testing-tool/u/0/" rel="noopener noreferrer"&gt;Structured Data Testing Tool&lt;/a&gt; by Google to test if Google is reading everything correctly. It should point out errors, if any, that you may need to correct.&lt;/p&gt;

&lt;p&gt;That's it! &lt;/p&gt;

</description>
      <category>seo</category>
      <category>html</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
