On-Page SEO: The Beginner’s Guide (2021)

Let’s first make sure we understand what on-page SEO is and why it matters.

What is on-page SEO?

On-page SEO (also called on-site SEO) is the practice of optimizing web pages to rank higher in search engines. It includes optimizations to visible content and the HTML source code.

Why is on-page SEO important?

Google looks at your page’s content to determine whether it’s a relevant result for the search query. Part of this process involves looking for keywords.

But there’s more to on-page SEO than including keywords in your content—a lot more.

Google is ultimately looking for the most relevant search result for a query, so their algorithms also look for other relevant content on the page. If your page is about dogs and you don’t mention different breeds, Google knows there are probably more relevant results out there.

Relevance is such a big part of on-page SEO that unless you crack it, you’re unlikely to rank.

Before you even think about making ‘technical’ optimizations like placing keywords here or there, you need to create content that Google wants to rank. For that, you need a main target keyword in mind. Read our keyword research guide if that’s not the case.

Otherwise, here are the four things you need to master:

  1. Be relevant
  2. Be thorough
  3. Be unique
  4. Be clear

1. Be relevant

Relevance is arguably the most crucial part of on-page SEO, which means aligning your content with search intent. Fail to give searchers what they want, and your chances of ranking are slim to none.

Because nobody understands search intent better than Google, the best starting point is to analyze the current top-ranking results for the three Cs of search intent:

  1. Content type
  2. Content format
  3. Content angle

We already briefly covered this concept in our keyword research guide. But we’ll go a bit deeper here, as again, aligning your content with intent is critical.

1. Content type

Content types usually fall into one of five buckets: blog posts, product, category, landing pages, or videos. For example, all the top-ranking pages for “black maxi dress” are ecommerce category pages from well-known stores.

If you want to rank for this keyword, it’s unlikely to happen with a blog post. Searchers are in buying mode, not learning mode.

For some keywords, however, things aren’t clear cut.

If we look at the top-ranking results for “plants,” you’ll see a mix of ecommerce pages and blog posts.

If this happens, use your best judgment. In this case, although there’s a roughly 50/50 split between blog posts and ecommerce pages in the results, the top three are ecommerce pages. That tells us that most searchers are looking to shop, not learn, so you’d probably stand the best chance at ranking for this keyword with an ecommerce page.

2. Content format

Content format applies mostly to blog posts, as they’re usually either how-tos, listicles, news articles, opinion pieces, or reviews.

For example, every result for “force restart iPad” are how-to guides, besides those from apple.com.

For the keyword “marketing ideas,” they’re all listicles.

To stand the best chance at ranking for either of these keywords, you should follow suit. Trying to rank a listicle when searchers want a how-to guide will be an uphill battle.

However, as with content type, the SERP isn’t always as clear-cut as in the examples above.

Just take a look at the top-ranking pages for “how to get more subscribers on youtube.” There’s a pretty even mix of blog posts in how-to and listicle formats.

US rankings for “how to get more subscribers on youtube” via Ahrefs’ Keywords Explorer.

In this case, because “how to” is in the target keyword, that would probably be the best way to go. But it’s worth noting that there isn’t exactly a definitive answer. Everyone sees things differently, and you could go either way. We chose the listicle format for our post about getting more YouTube subscribers because it seemed like a better match for the tips we wanted to share.

Our page ranking in position #9 for “how to get more youtube subscribers.”

2. Content angle

Content angle refers to the main ‘selling point’ of the content. For example, those searching for “how to make latte” seem to want to know how to make it at home—without specialist equipment.

For “best macbook,” people are clearly looking for fresh results.

Just in case you didn’t get the gist by now, content angle isn’t always this clear cut. If you look at the top results for “fried rice recipe,” there are multiple angles: best, easy, restaurant-style, etc.

In this case, the perfect content angle is anyone’s guess. Just go for the angle you think would be most appealing and useful for someone searching for “how to make fried rice.”


While it’s important to align your content with what searchers expect, you might not always want to follow the herd. If you’re confident that you can get searchers’ attention with a different content type, format, or angle, feel free to give it a shot.

2. Be thorough

Having content that broadly aligns with search intent is a good start, but it’s rarely enough. To be deserving of a place on the first page of Google, it needs to deliver on its promise. And that means covering all the things searchers expect and want to see.

Given that you’ve identified the three Cs of search intent, you probably already have a rough idea of what searchers might want to see. For example, if you’re writing about how to buy Bitcoin and the top-ranking pages are for beginners, it probably wouldn’t be wise to explain the blockchain in intricate detail.

However, analyzing the three Cs only gives you a high-level view of intent. To better understand what your content should cover, you need to dig deeper by further analyzing relevant top-ranking pages.

The keyword here is “relevant.” If you’re targeting the keyword “best golf club sets” and plan to write a post about the best sets, then there’s no point analyzing and taking inspiration from top-ranking ecommerce pages or posts about individual clubs. You want to analyze similar pages to yours.

Let’s look at how to do that.

Look for common subheadings

Most pages break a topic down into subtopics with subheadings. These offer quick insights into what searchers are looking for, especially if you notice the same or similar subheadings across multiple pages.

For example, if we check the subheadings for other on-page SEO guides, we see that each page features a definition.

Definition from the #1 page for “on page seo.”

Definition from the #2 page for “on page seo.”

Definition from the #3 page for “on page seo.”

Given that all relevant top-ranking pages include this, it’s reasonable to conclude that it’s something searchers want to know. Google probably knows that pages covering these things lead to higher user satisfaction than those that don’t—and chooses to rank them higher.

If you’re writing a listicle, you can also look to subheadings for insights into specific products, services, or tips you might want to include.

For example, if we use the free on-page report in Ahrefs SEO toolbar, you’ll see that the top-ranking pages for “best golf club sets” mention some of the same sets.

Just remember to take this approach with a pinch of salt. If your keyword is ‘best golf club sets’ and all the top-ranking pages mention a set that you know is terrible, you shouldn’t include it just because everyone else did.

Look for subtopics among keyword rankings

According to our study of three million search queries, the average top-ranking page ranks for nearly 1,000 other relevant keywords in the top 10.

Many of these keywords will be other ways of searching for the same thing. For example, if we plug the top-ranking page for ‘best golf club sets’ into Ahrefs’ Site Explorer and check the Organic Keywords report, we see that it also ranks for keywords like:

  • best set of golf clubs
  • best golf club sets 2020
  • good set of golf clubs
  • best complete golf sets
  • best golf set

But some keywords will represent subtopics that fall under the broader topic.

For example, that same page also ranks in the top 10 for:

  • mens golf club sets
  • best budget golf clubs
  • best golf club brands
  • golf club set with bag
  • best amateur golf clubs

Looking for subtopics among keywords of relevant top-ranking pages is an excellent way to find things you might want to cover in your content.

Another way to do this is to look for keyword intersections between multiple pages. To do that, plug a few relevant page URLs into Ahrefs’ Content Gap tool, then play around with the number of intersections until you have a meaningful set of results.

… then adjust the “intersect” toggle until you see keywords that represent subtopics.

Look at the pages manually

Finding common subheadings and keywords is the fastest way to get some insight into what to cover. But you can’t learn everything that way. There’s no substitute for manually analyzing the pages to get a better sense of the topic.

If we open the top three pages about the best golf club sets, we notice that most of the featured sets are beginner sets under $300. None are listing the actual “best” sets because those cost thousands and thousands. This tells us that it’s mostly beginners searching for this keyword, so there’s no point reviewing high-end products because searchers won’t find that useful.

Beyond that, we see that most top pages list pros and cons for each set.

The #1 page for “best golf club sets” lists pros and cons…

…and so does the #2 page.

That gives us clues about how we should structure our post for searchers and the product attributes they care about the most. For instance, it looks like the bag’s durability is a selling point for those in the market for a set of clubs.

Look at SERP features

Beyond analyzing competing pages, there’s also something to learn by checking SERP features like featured snippets and ‘People also ask’ (PAA) boxes.

For example, while there’s no featured snippet for ‘best golf clubs,’ there is a PAA box. And these questions offer insights into other things searchers might want to know.

The ‘People Also Ask’ box for “best golf club sets.”

That second-to-last question tells us that searchers are probably quite price-conscious and want a quality set of clubs for a fair price. This confirms what we thought after manually analyzing the top-ranking pages. Most searchers are almost certainly beginners and aren’t looking for the absolute top of the line clubs.

If we look at the results for “how to swing a golf club,” we see that the featured snippet is a video from YouTube.

Youtube video in the featured snippet for “how to swing a golf club.”

Even if you were to target this keyword with a blog post, the fact that there’s a video ranking in the snippet tells us that searchers probably want visual aids. For that reason, it’d make sense to include videos or images demonstrating the swing in your post.

3. Be unique

It’s vital to give searchers what they want, but you also need to bring something new to the table. Fail to do this, and your content will be like everyone else’s. And nobody wants to link to another ‘me too’ piece of content.

Everything we’ve covered so far should have provided a winning framework for your content, but there should still be scope for some creativity.

For example, if we look at the SERP for “SEO tips,” the intent is clear. People want a list of tips to improve rankings and boost traffic.

That’s what we created, as you can see from the post ranking in spot #2.

But while many of the tips on our list aren’t unique, there are some that you won’t find anywhere else. One is to embed videos in relevant posts to get traffic from Google. If someone comes across our page, finds that tip useful, and decides they want to share it with others, they have no choice but to share or link to our page.

It’s a little harder to do this with other content types, but it’s still possible.

For example, it might seem near impossible to make a unique product or category page, but you can always utilize things like:

  • Better filters
  • Better product photography
  • Unique product descriptions
  • Reviews

4. Be clear

No matter how well your content aligns with search intent or how thorough it is, nobody will read it if it’s unclear. For example, the page below matches user intent for the keyword “all grain brewing”—but it’s a wall of tiny text that nobody wants to read.

Great result, but it’s a wall of text!

Follow these simple tips to create clear content that people will want to read:

  • Use bullets to help skimmers.
  • Use descriptive subheadings (H2-H6) for hierarchy.
  • Use images to break up the text.
  • Use simple words that everyone can understand.
  • Use short sentences and paragraphs to avoid “walls of text.”
  • Use a large font to help readers avoid eye strain.
  • Write as you speak to make things more entertaining and conversational.

It’s about making it as easy as possible for searchers to find what they’re looking for. If you cover everything people want to know on your page, but they can’t find it, they’re going to hit the back button in search of a page that’s clearer and easier to digest.

Besides the advice above, we also recommend putting the ‘need to know’ before the ‘nice to know.” This is known as the inverted pyramid method.

For example, when we were writing our guide to 301 vs. 302 redirects, there was a lot of ground to cover. But we also knew from analyzing the SERP that most searchers just wanted to know the difference between the two types of redirects. So although we wrote a thorough guide explaining the ins and outs of both, we made sure to summarize the key difference in one sentence at the beginning of the post.

If you’re not sure about the ‘nice to know’ and ‘need to know’ for your topic, take another look at the top-ranking pages. If we do this for our’ best golf clubs’ example, we see that they all list the top golf club sets before going into details about each set, so people probably want the top picks before pros and cons and other information.

Creating the kind of content that Google and searchers want to see is the hard part. Now you just need to optimize the ‘technical’ stuff like meta tags and URLs. This is the icing on the cake and helps make it doubly clear to Google and searchers that your page is the best result.

Here’s a quick checklist.

1. Include your keyword in the title

Page titles usually get wrapped in an H1 tag. That’s probably why including your keyword in the title has been conventional SEO wisdom since forever.

Google’s John Mueller even confirmed the importance of headings in 2020.

And when it comes to text on a page, a heading is a really strong signal telling us this part of the page is about this topic.

Including the keyword in the title is second nature to most SEO professionals. You’ve probably spotted them in our post titles before.

Keywords in our title tags.

Just know that it won’t always make sense to use the exact keyword in your title, but rather a close variant. For example, the main target keyword for this post is “seo outsourcing,” but the title is “How to Outsource SEO (Simple Framework).”

It’s also important to keep your titles sounding natural, so use conjunctions and stop words where necessary.

2. Use short, descriptive URLs

Short and descriptive URLs help searchers to understand what a page is about before clicking.

For example, look at these two URLs:


Both pages are about the same thing, but that isn’t obvious from the URLs. Only the second URL tells you what the page is about, which makes for an arguably clearer and more clickable result in the SERPs.

Most CMS’ let you change the URL slug (the part after the domain and subfolders) easily, and setting it to your target keyword is often the simplest way to optimize. We do this for nearly all our blog posts.

Just know that this is another case of using the target keyword if and when it makes sense. In some cases, a variation might be better. For example, our target keyword for this post is “how long should a blog post be.” But as this seemed a bit long and awkward, we went with “blog post length” instead.

Keeping things short is important because Google truncates lengthy ones in the SERPs.

3. Optimize your title tag

Having a compelling title tag is important because it shows up in the search results.

Often, the simplest way to create one is to set it as your page or post title. This is what we do for nearly all blog posts. For example, the post above has the same title and title tag.

This is also the title tag for our post.

However, there are times when it makes sense to switch things up slightly, such as when your title is too long. As with URLs, Google truncates lengthy title tags in the search results.

Use common sense to shorten titles that are too long. For example, in our content writing guide, we just cut off the end.


 If you’re creating title tags for hundreds or thousands of similar pages, such as product, category, or service pages, you’ll probably want to use the same formula for them all. You can learn more about how to do that in our guide to title tags linked below. 

4. Write a compelling meta description

Google often shows a page’s meta description as the descriptive snippet in the SERP.

How often? According to our study of 192,000 pages, roughly ⅓ of the time.


Google dynamically generates descriptive snippets the rest of the time.

Meta descriptions are not a ranking factor, but they’re still important because an enticing description can lead to more clicks and traffic.

Use these tips to write a compelling description fast:

  1. Expand on your title tag. Include USPs that you couldn’t fit in the title.
  2. Match search intent. Double down on what searchers are looking for. 
  3. Use active voice. Address the searcher directly.
  4. Be concise. Keep it around 120 characters or less.
  5. Include your keyword. Google bolds words and phrases closely related to the query.

Don’t spend too much time writing meta descriptions as they’re relatively unimportant in the grand scheme of things.

5. Optimize your images

Images can rank in Google image search and send more traffic your way. In fact, over the past 28 days, we’ve had over 4,000 blog visits from image search.

Search visits to the Ahrefs Blog from Google Images over 28 days.

Here’s a quick three-step checklist for optimizing your images.

a) Name images appropriately

Google says that filenames give them clues about the image’s subject matter, so dog.jpg is better than IMG_859045.jpg.

Unfortunately, most cameras and smartphones use generic names for photos and images. And so do computers. If you’re taking screenshots for a blog post, they’ll usually be named something like Screenshot 2021-01-12.png.

For that reason, you should rename them. Here’s how:

  • Be descriptive. black-puppy.jpg > puppy.jpg
  • Be succinct. black-puppy.jpg > my-super-cute-black-puppy-named-jeff.jpg
  • Don’t stuff keywords. black-puppy.jpg > black-puppy-dog-pup-pooch.jpg
  • Use dashes between words. black-puppy.jpg > black_puppy.jpg (this is Google’s official recommendation)

b) Use descriptive alt text

Alt text (alternative text) is an HTML attribute used on tags to describe the image. It’s not visible on the page itself and looks something like this:

The primary purpose of alt text is to improve accessibility for visitors who use screen readers. These convert page content, including images, to audio. Browsers also show alt text in place of images if the image fails to load.

Google’s John Mueller has also stated that alt text can help you rank in Google Images:

When creating alt text, Google says to ‘focus on creating useful, information-rich content that uses keywords appropriately and is in context of the page’s content.’ But they also say to ‘avoid filling alt attributes with keywords (keyword stuffing) as it results in a negative user experience.’

With that in mind, here’s our best advice for creating alt text:

  • Be descriptive. Use relevant keywords where appropriate.
  • Be concise. Keep things short to avoid annoying users with screen readers.
  • Be accurate. Describe what’s actually in the image.
  • Avoid keyword stuffing. It can ’cause your site to be seen as spam.’
  • Avoid stating that it’s an image. Don’t include “Image of…” or “Picture of…” in descriptions. Google and screen readers can work that out for themselves.

Let’s write some alt text for this photo of a puppy to demonstrate:





If you’re a WordPress user, you can easily add alt text to images when inserting them into posts.

Here are instructions for adding alt text in Squarespace, Wix, and Shopify.

c) Compress images

Compressing images makes file sizes smaller, leading to faster load times. That’s important because page speed is a ranking factor on desktop and mobile.

Plenty of tools exist for compressing images, but ShortPixel is one we like. It has a web interface where you can compress up to 50 images at a time for free and a WordPress plugin that compresses images when you upload them.


You can compress up to 100 images per month with the free version of ShortPixel, then from a fraction of a penny per image after that. 

5. Add internal and external links

Linking to relevant internal and external resources helps visitors navigate your website and find more information. Yet, some say that linking to other websites is bad for SEO.

This is a myth. There’s no evidence to suggest that linking to other websites will hurt your SEO.

In fact, Google’s John Mueller says:

Linking to other websites is a great way to provide value to your users. Often times, links help users to find out more, to check out your sources and to better understand how your content is relevant to the questions that they have.

While he didn’t say anything about the SEO implications of outbound links here, he did say that they help users. And we know from Google’s guide to how search works that the search engine is designed to help people ‘find the most relevant, useful results.’

Of course, this doesn’t mean you should link anywhere and everywhere for the sake of it. Just link to internal and external resources that make sense such as sources, product recommendations, or related blog posts. You’ll notice that we’re linking to plenty of internal and external resources throughout this guide.

Everything we’ve covered so far is enough to optimize pages well, but there are other things you can do. So if you’re already ranking well and want to push things higher or just want to go to town with your on-page SEO, here are a few ‘advanced’ optimizations.

1. Optimize for featured snippets

Featured snippets are a type of SERP feature that often show near the top of the search results. They answer the searcher’s question with a short excerpt pulled from one of the top-ranking pages.

Featured snippet for “what are local citations.”

Because the snippet’s answer comes from a page in the search results, it’s possible to effectively shortcut your way to the top position by ‘winning’ the snippet.

Doing this is often easier said than done, but the basic process is:

  1. Be in the top 10. Google usually pulls the snippet from one of these pages.
  2. Make sure Google already shows a featured snippet. You’ll use this to understand how to ‘answer’ the query.
  3. Provide the answer on your page. Google can’t pull from your page if it’s not there.
  4. Use the right format. Paragraph, list, or table—what do Google and searchers expect to see?

For example, let’s say that we wanted to see whether there are featured snippet opportunities for our post about evergreen content. If we plug the URL into Ahrefs’ Site Explorer, filter the Organic keywords report top 10 rankings, we see that we’re already ranking in the top 10 for ‘evergreen content.’

Our US ranking for “evergreen content” via Ahrefs’ Site Explorer.

If we check the SERP, we see that the current featured snippet is a short paragraph with a definition of the term.

Definition in the featured snippet for “evergreen content.”

To be in the running for this featured snippet, we’d need a definition on our page.

If, on the other hand, we wanted to win the snippet for ‘most visited websites,’ we’d probably need to include a table with top searches and their monthly search volumes.

Table in the featured snippet for “most visited websites.”

2. Embed link magnets

Links remain an important Google ranking factor. And while link building is off-page SEO, not on-page SEO, you can entice more links by including linkable snippets on your page.

How do you know what a linkable snippet is?

Look at why people are linking to similar, competing pages.

For example, the main target keyword for one of our posts is “long tail keywords.” If we plug that keyword into Ahrefs’ Keywords Explorer, we see a few similar posts with plenty of backlinks.

Let’s plug just one of these posts into Site Explorer and check the Anchors report. This shows the most common words and phrases people use when linking to the page. In this case, we see a lot of people linking due to statistics.

That tells us we should probably include some statistics in our post to increase ‘linkability.’

If we switch gears and check the Anchors report for a top-ranking page for “SEO copywriting,” we see many people linking because of two unique concepts.

It probably wouldn’t make sense for us to include these same concepts in our post, but we can include some unique ideas of our own to increase linkability. That’s what we did when we wrote about SEO copywriting.

3. Get rich snippets with schema markup

Rich snippets are search results with additional information below the title, description, and URL.

For example, Google shows ratings, cooking time, and calories for these recipe pages.

Google pulls this information from a type of structured data on the page called schema markup. In this case, the pages are using a specific type of schema markup called recipe markup.

Here are a few other types of schema markup that can lead to rich snippets:

  • How-to markup
  • Product markup
  • Review markup
  • Software markup
  • FAQ markup

For example, here’s a page in the SERP that uses FAQ markup:

FAQ rich snippets.

Although rich snippets are not a ranking factor, many believe that rich snippets can entice more clicks—at least for some pages.

If you use WordPress, you can add schema markup to posts and pages with popular plugins like Yoast or Rank Math. Just know that not all types of content are eligible for search enhancements like rich snippets.

4. Improve topical relevance

Google deems a page more relevant for the search query when it ‘contains other relevant content besides the keyword.’ For example, if your page is about dogs, listing breeds would probably make for a more relevant result when someone searches ‘dogs.’

If you followed the advice in chapter two, your content should already include many relevant words, phrases, and concepts. It’ll happen naturally as you write.

However, it’s easy to miss things—especially with complex topics.

For example, this is one of the top-ranking results for ‘how to brew beer.’ It’s a fairly thorough guide for a beginner but fails to mention the fact that you’ll need a siphon to transfer your beer from the fermenter to bottles.

Page about making beer that lacks important details.

In this case, if you’re not ranking where you’d like and aren’t sure why that is, it might be worth looking deeper into what you might have missed from your page.

Here are a few ways you can do that.

Use the ‘Also talk about’ report

The ‘Also talk about’ report in Keywords Explorer shows keywords and phrases frequently mentioned by the top 100 ranking pages. Just plug in your target keyword to see what the top-ranking pages talk about at a glance.

For example, if we check the report for ‘how to brew beer,’ we see many keywords relating to ingredients and equipment like:

  • hops
  • yeast
  • malted barley
  • malt extract
  • wort chiller
  • mash tun
  • auto siphon

Things that top-ranking pages for “how to brew beer” also talk about via Ahrefs’ Keywords Explorer.

Given that aspiring brewers need to know about most of these things, it’d be worth talking about them in a beginner’s brewing guide. If you’ve neglected to include these things, it might be worth updating.

Just know that you should use common sense when doing this. The fact that a word or phrase appears in the ‘also talk about’ report doesn’t necessarily mean that you should talk about it in your content. Use the report to uncover relevant things that you missed.

Run a TF-IDF analysis

TF-IDF stands for Term Frequency-Inverse Document Frequency. It’s a statistical measure that aims to judge the relative importance of a word in a document. It does this by comparing how often the word occurs in that document compared to a bunch of others.

By running a TF-IDF analysis between yours and other relevant top-ranking pages, you can sometimes uncover concepts covered by competing pages that you missed.

For example, if we do this for our post about negative SEO, we see that competing pages talk about things like the disavow file and unnatural links.

Just know that the idea here isn’t to ‘sprinkle these keywords’ into your content, but rather to uncover relevant ideas and concepts that you might have forgotten to mention. You can then update things to create a more relevant and comprehensive page.

Also, be aware that most TF-IDF tools suggest using ‘important’ words and phrases a specific number of times on your page. This is not how we recommend using them.

What about LSI keywords?

LSI keywords don’t exist.

Popular ‘LSI keyword’ tools are entirely unrelated to LSI, and it’s unclear how they generate their keyword suggestions. Although they can kick back useful ideas under some circumstances, their suggestions are rarely fantastic in my experience.

Let’s look at a few free tools to help with everything above before we wrap things up.

Yoast SEO

Add titles, meta descriptions, OG tags, and structured data to posts and pages.

Ahrefs Webmaster Tools (Free)

Find missing issues with title tags, meta descriptions, alt text, and OG tags across your site.

Ahrefs SEO Toolbar (Free)

Analyze the structure of other top-ranking pages.

MetaTags.io (Free)

Preview how title tags, URLs, and meta descriptions will look in the search results.

ShortPixel (Free)

Compress and optimize images.

Merkle’s Schema Markup Generator (Free)

Create many types of structured data in Google’s recommended JSON-LD format.

Rich Results Test (Free)

Check the structured data on your page to see if it’s eligible for rich snippets in the SERPs.

Let’s wrap this up

Follow the advice above, and your pages will likely be better-optimized than the competition. Just remember that satisfying search intent is the most critical part. While the ‘technical’ things are also important, they’re more like the icing on the cake.

Now let’s move on to the next piece of the SEO puzzle: link building.

Here’s the Source of this Content