
How to Test Robots.txt Before It Goes Live (2026)
A bad robots.txt file can hide your whole site from Google. This guide shows how to test it in Search Console, check single pages, and avoid the most common mistakes.

A canonical tag is a small piece of code that tells Google which version of a page is the main one. If two or more pages on your site look the same, or nearly the same, Google can get confused about which one to show in search results. A canonical tag points Google to the version you want ranked. It takes one line of code, it costs nothing, and it can save a small business site from splitting its ranking power across duplicate pages.
A canonical tag is an HTML link element that sits in the <head> section of a web page. It looks like this:
<link rel="canonical" href="https://example.com/blue-shoes/" />
That one line says: “Of all the pages that look like this one, treat https://example.com/blue-shoes/ as the real page.” The word “canonical” just means the official or main version.
Here is a simple way to think about it. Imagine you own a shoe shop and you print the same flyer in three colors. A customer asks which flyer is the real one. A canonical tag is you pointing at one flyer and saying, “This is the one. The others are copies.” Google then sends ranking credit to the page you pointed at, instead of spreading it across all three.
Two things to know from the start:
Most small business sites create duplicate pages without meaning to. A product page can load under several web addresses at once:
https://example.com/blue-shoes/https://example.com/blue-shoes/?color=bluehttps://example.com/blue-shoes/?utm_source=facebookhttps://example.com/blue-shoes (no trailing slash)http://www.example.com/blue-shoes/ (old http and www version)To a visitor, these are all the same page. To Google, each web address can look like a separate page. That causes three problems:
1. Split ranking power. If five other sites link to five different versions of your page, each version gets a small share of the credit. With a canonical tag, the credit flows to one page, and that page ranks higher.
2. Wasted crawl time. Google only spends so much time crawling a site. On a small site this rarely matters, but on a shop with hundreds of filtered product pages, Google can waste crawl time on copies instead of finding your new pages.
3. The wrong page in search results. Without a canonical tag, Google might show the version with tracking code in the address (?utm_source=facebook) instead of the clean version. That looks messy in search results and can cost you clicks.
Let us walk through one real case from start to finish, because this is the case most small shops actually face.
Sara runs an online shoe shop. Her best seller is a blue running shoe. The product page lives at https://sarashoes.com/blue-running-shoes/. Over time, four more addresses lead to the same page:
https://sarashoes.com/blue-running-shoes/?color=blue — a shopper filtered by colorhttps://sarashoes.com/blue-running-shoes/?sort=price-low — a shopper sorted by pricehttps://sarashoes.com/blue-running-shoes/?utm_source=instagram — a visitor from an Instagram adhttps://sarashoes.com/blue-running-shoes — the same page without the trailing slashSara picks the clean address as her canonical page: https://sarashoes.com/blue-running-shoes/. Then she makes sure every copy of the page carries this tag in its <head>:
<link rel="canonical" href="https://sarashoes.com/blue-running-shoes/" />
She does not delete the filtered or tracked versions. Shoppers still use them, and the links still work. She only tells Google which version counts. After a few weeks, Google shows the clean address in search results, and the links pointing at the copies start helping the main page instead of splitting the credit.
That is the whole job for most small sites: pick one main address per page, and point every copy at it.

Beginners mix these two up. They solve different problems. Here is the short version:
| Canonical tag | 301 redirect | |
|---|---|---|
| Who sees it? | Only search engines | Search engines and visitors |
| What happens to the visitor? | Nothing. They stay on the page they opened. | They are moved to the new page. |
| What gets indexed? | The canonical page. The copy may stay indexed too. | Only the new page. The old address drops out of search. |
| When to use it | Two or more live pages need to stay live, but one should rank. | A page is gone for good, or it moved to a new address. |
| Ranking credit | Mostly passed to the canonical page, but Google treats it as a hint. | Passed to the new page. This is the stronger signal. |
The decision rule is simple. If the page should stay live for visitors, use a canonical tag. If the page is gone or has moved for good, use a 301 redirect. Never use both on the same page pointing at different addresses. That sends Google two opposite messages, and it will trust neither.
You need a canonical tag when the same content, or nearly the same content, can be reached at more than one address. The common cases for small business sites are:
If you edit your site code by hand, add this line inside the <head> section of each duplicate page, with the full address of the main page:
<link rel="canonical" href="https://example.com/main-page/" />
Use the full address, starting with https://, not a short form like /main-page/. Keep the address in lower case, and keep the trailing slash the same on every page. One tag per page, and it must sit in the <head>, not the <body>. A canonical tag in the body is ignored by Google.
WordPress already adds a self-referencing canonical tag to every page, which means each page points at itself by default. That is fine for most pages. You only need to change it when a page should point at a different page.
To set a custom canonical URL in Rank Math:
To check what Rank Math is doing, view the page source in your browser (right-click, then View Page Source) and search for “canonical”. You should see one tag with the right address.
Yoast SEO also adds self-referencing canonical tags by default. To change one, open the post, open the Yoast SEO panel, go to the Advanced settings, and paste the full address into the Canonical URL field. Yoast has a help page on canonical URLs that walks through the same steps with screenshots.
In AIOSEO, open the post or page, find the AIOSEO Settings box, open the Advanced tab, and paste the full address into the Canonical URL field. The steps are nearly the same as Rank Math and Yoast. Pick one plugin and stick with it. Running two SEO plugins at once can add two different canonical tags to the same page, and that is one of the mistakes in the checklist below.
Shopify adds self-referencing canonical tags to product and collection pages on its own. Wix and Squarespace do the same. On these platforms you rarely need to touch canonical tags unless you sell the same product under several addresses or you syndicate content. Check your platform help pages before installing a third-party app to manage canonical tags.
A self-referencing canonical tag is a tag that points at the page it sits on. The page at https://example.com/about/ carries a tag that says the canonical page is https://example.com/about/.
It sounds pointless, but it has a real job. It protects the page from its own copies. If someone links to your page with a tracking code, or Google finds the page with and without a trailing slash, the self-referencing tag tells Google which exact address is the real one. That is why WordPress, Shopify, Wix, and Squarespace all add self-referencing canonical tags by default.
For a normal page with no duplicates, a self-referencing tag is all you need. You only write a different canonical address when the page is a copy of another page.
A canonical tag can point to a page on a different website. This is called a cross-domain canonical, and it matters when your content is republished somewhere else.
Say you write a guide on your site, and a bigger publication republishes it. Without a canonical tag, Google may show the bigger site’s copy in search results instead of yours, even though you wrote it first. If the republished copy carries a canonical tag pointing back to your original, Google knows which one is the source.
How to handle it in practice:
You do not need paid tools to check canonical tags. Two free checks cover most cases.
Check one page by hand. Open the page in your browser, right-click, and pick View Page Source. Press Ctrl+F (or Cmd+F on a Mac) and search for “canonical”. You should find exactly one tag, in the <head> section, pointing at the address you expect. If you find none, or two, or one pointing at the wrong page, you have a problem to fix.
Check the whole site in Google Search Console. Search Console is free, and it shows you what Google actually did with your canonical tags:
After you fix a canonical tag, go back to the URL Inspection tool and click Request Indexing. Google still needs time to re-crawl the page, often a few days and sometimes a few weeks. A fix is not instant, so check again after a week instead of the same day.

Google treats a canonical tag as a hint, so it sometimes picks a different page. Work through this list in order before you change anything else:
Most canonical tag problems come from a short list of beginner errors. Check your site against this list:
https://example.com/page/), not a short form like /page/. Short forms can be read the wrong way./page/ and /page are different addresses. Keep the slash the same in the tag as in the real address.Probably not much, and that is fine. Google itself has said a small site will likely do just fine without setting canonical tags by hand, because most platforms add them for you.
Here is a quick way to decide:
If you hire someone to fix this, it is a small job. A developer can audit and set canonical tags on a small site in an hour or two. You do not need a monthly plan for it. Set it up once, then check it when you add new page types, change your shop filters, or start running ads with tracking codes.
A real example looks like this, placed in the <head> of a duplicate page: <link rel="canonical" href="https://example.com/blue-shoes/" />. It tells Google that the blue shoes page at that address is the main version, and any copies should pass their ranking credit to it.
Canonical means the official or main version. A canonical tag names the one official version of a page when several copies exist, so Google knows which one to show in search results.
Open the page, right-click, and pick View Page Source. Search the page for “canonical”. You should see one tag in the <head> section with the full address of the main page. If the address is wrong, or there are two tags, fix it in your SEO plugin or in the page code.
It is a canonical tag that points at the page it sits on. It tells Google that this exact address is the real version of the page, which protects it from copies made by tracking codes, filters, or trailing-slash differences. Most platforms add one to every page by default.
For a tiny site with no duplicate pages, no. Your platform already adds self-referencing tags. For a shop with filters and tracking codes, or a blog that gets republished, yes. They stop your ranking power from splitting across copies of the same page.
A URL is the address of any page. A canonical URL is the one address you have chosen as the main version when several addresses lead to the same content. The canonical URL is the one Google should show in search results.
Usually a few days to a few weeks after Google re-crawls the page. Use the URL Inspection tool in Search Console to ask Google to re-crawl the page, then check again after a week. If nothing changed, work through the checklist in the “Google ignored my canonical tag” section above.
Last updated: November 2026

A bad robots.txt file can hide your whole site from Google. This guide shows how to test it in Search Console, check single pages, and avoid the most common mistakes.

Verification proves to Google that you own your site. This guide walks through the DNS record, HTML file, HTML tag, Analytics and Tag Manager methods, and what to do when verification fails.

A simple 12-step guide to writing content that ranks on Google and reads well — with free tools, a worked example, and the mistakes to avoid.