The <base> HREF should refer to the folder path and not the actual page URL.

If your <base> tag references the page that it’s on, you can update the directive. Here’s how.  

Table of Contents

The Problem With Base Tags Pointing to the Page URL

The <base> HREF directive provides a reference for relative links on the page.

Having the <base> point to the page URL is incorrect coding and could lead to crawlers discovering thousands of malformed links, causing errors when crawling your site.

How to Solve the Issue

If the <base> HREF refers to the page and not the folder path, follow the example below to update it.

Let’s use this sample URL:

https://seoautomation.io/playbook/base_same_page.html         

When looking at  the HTML for this page (you can do this with the “Inspect” feature of your browser), we see that the <base> tag’s HREF is the same as the page’s URL:

<base href="https://seoautomation.io/base_same_page.html">

Instead, since the <base> tag should refer to the path (i.e. https://seoautomation.io) this tag needs to be updated to be:

<base href="https://seoautomation.io/">

If you have direct edit access in your CMS, you can update your tag on a page-by-page basis. If you don’t have the proper edit access, you can bring in the dev team to help make the update.

How to Update Base Tags at Scale

If your <base> tag refers to the page itself, you can update it in a matter of minutes with SEO execution platform ClarityAutomate.

1. Select what you'd like to optimize: Code

First, select “Code” within ClarityAutomate since the <base> tag is part of the HTML.

2. Choose how you'd like to optimize it: Update

No additions or deletions need to be made in this case. Instead, an existing <base> tag will be updated.

3. Location: CSS/XPath that points to the <base> on the page

This step specifies the <base> tag on the page to be updated.

4. Attribute: href

The specific attribute of the <base> tag to be updated is the HREF.

5. New Value: The HREF of the folder path

This will update the HREF — remember to reference the folder path. Then, you can push your changes live!

Before and After

With ClarityAutomate, we were able to change the <base> tag’s HREF from the specific URL to the folder path, all without the dev team!


Looking for other base tag issues?