Advanced Head Tag Manager Plugin
The Advanced Head Tag Manager plugin offers extensive control over the metatags of your Publii website. This comprehensive guide provides step-by-step instructions on effectively enabling, configuring, and using this plugin.
While the Advanced Head Tag Manager plugin offers powerful customization options for your website's metatags, it requires a good understanding of SEO principles and web development. Incorrect usage can potentially negatively impact your site’s SEO performance. Ensure you are familiar with SEO best practices before making advanced changes.
Enabling the Plugin
- Open the Publii application and navigate to the Tools & Plugins section.
- Locate the Advanced Head Tag Manager plugin in the list of installed plugins.
- Activate the plugin by clicking the switch button at the bottom-left corner of the plugin tile.
Advanced Head Tag Settings
This section provides a range of options to customize various aspects of how metatags are managed on your website. The settings are organized into different groups, such as "Global Changes," "Homepage," "Posts,", "Pages" and more, allowing you to tailor the plugin's behavior both globally and for specific types of pages.
Global Changes
Unless overridden by specific page settings, these settings apply globally across your entire website.
- Remove generator metatag: Enabling this option will remove the generator metatag that typically displays "Publii Open-Source CMS for Static Site." This is useful for obscuring your CMS, which can be a security measure.
- Remove charset metatag: This allows you to remove the charset metatag, which specifies the character encoding for the HTML document. If you remove this metatag, add your own appropriate charset declaration to avoid character encoding issues.
- Remove viewport metatag: Removes the viewport metatag, affecting how your site scales on mobile devices. Be cautious with this setting, as the absence of a viewport metatag can significantly impact your website's mobile-friendliness, which Google considers for ranking. Only remove this metatag if you intend to use a custom viewport metatag. Neglecting this can result in your website being treated as non-mobile by search engines, adversely affecting your site's SEO.
- Remove X-UA-Compatible metatag: This removes the metatag used for specifying document compatibility modes in IE.
- Metatags to Remove: You can specify additional metatags to be removed globally from your site. You'll have to determine the
type
(name
,property
, orhttp-equiv
) and thevalue
for each tag. - <head> code to add: Add custom code snippets to all pages' head sections. For dynamic content, you can use insertions like
{meta_title}
,{meta_description_raw}
,{meta_description_raw}
,{meta_robots_raw}
Example:<meta name="custom-meta" content="{meta_title}">
Homepage
These settings apply only to the homepage, overriding any global settings.
- Modify homepage metatags: Check this box to enable customization of homepage-specific metatags.
- Metatags to Remove: Add specific metatags to be removed from the homepage. Similar to the global settings, you'll need to specify the
type
andvalue
. - <head> code to add: Add custom code to the head section of the homepage. The same insertions available in global settings can be used here.
Example:<meta name="custom-meta" content="{meta_title_raw}">
Posts, Pages, Tags, Authors, Pagination, 404 Error Page, and Search Page
For each section corresponding to the type of page, you can enable or disable the modification of metatags specific to those pages. These settings will override global settings if enabled. Each section allows you to:
- Remove specific metatags
- Add custom code to the
<head>
section
Each page type, such as the homepage, has unique insertions that can be checked in the notes provided within the plugin or in the table below:
Page Type | Available Insertions |
---|---|
Global Changes | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw} |
Homepage | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw} |
Posts | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw}, {post_id}, {post_title}, {post_slug}, {post_url}, {post_author_name}, {post_author_username}, {post_author_avatar}, {post_author_avatar_image_alt}, {post_author_avatar_height}, {post_author_avatar_url}, {post_author_avatar_width}, {post_author_email}, {post_author_website}, {post_author_posts_number}, {post_author_description}, {post_author_url}, {post_featured_image_url}, {post_featured_image_alt}, {post_featured_image_caption}, {post_featured_image_credits}, {post_featured_image_height}, {post_featured_image_width}, {post_featured_image_srcset}, {post_featured_image_sizes} |
Pages | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw}, {page_id}, {page_title}, {page_slug}, {page_url}, {page_author_name}, {page_author_username}, {page_author_avatar}, {page_author_avatar_image_alt}, {page_author_avatar_image_height}, {page_author_avatar_image_url}, {page_author_avatar_image_width}, {page_author_email}, {page_author_website}, {page_author_posts_number}, {page_author_description}, {page_author_url}, {page_featured_image_url}, {page_featured_image_alt}, {page_featured_image_caption}, {page_featured_image_credits}, {page_featured_image_height}, {page_featured_image_width}, {page_featured_image_srcset}, {page_featured_image_sizes} |
Tags | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw}, {tag_id}, {tag_name}, {tag_description}, {tag_slug}, {tag_url}, {tag_featured_image_url}, {tag_featured_image_alt}, {tag_featured_image_caption}, {tag_featured_image_credits}, {tag_featured_image_height}, {tag_featured_image_width}, {tag_featured_image_srcset}, {tag_featured_image_sizes} |
Authors | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw}, {author_id}, {author_name}, {author_username}, {author_avatar}, {author_avatar_image_alt}, {author_avatar_image_height}, {author_avatar_image_url}, {author_avatar_image_width}, {author_email}, {author_website}, {author_posts_number}, {author_description}, {author_url}, {author_featured_image_url}, {author_featured_image_alt}, {author_featured_image_caption}, {author_featured_image_credits}, {author_featured_image_height}, {author_featured_image_width}, {author_featured_image_srcset}, {author_featured_image_sizes} |
Pagination | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw} |
404 Error Page | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw} |
Search Page | {meta_title}, {meta_title_raw}, {meta_description_raw}, {meta_robots_raw} |