Trellis Hooks Settings Overview

Everything you need to know about the Hooks settings in Trellis.

Palmer Zona avatar
Written by Palmer Zona
Updated over a week ago

What Are Trellis Hooks?

Trellis has built-in Hooks functionality, which allows you to easily add scripts, meta tags, affiliate disclosures, and more to your site. With Hooks, you won't have to search for where to insert different scripts you need, and they also often eliminate the necessity to use additional code-inserting plugins as well.

You can find the Hooks settings by logging into your WordPress Admin and navigating to Appearance → Mediavine Trellis → Hooks.

To follow best practices, the custom content being output with Trellis Hooks should always be wrapped in either an appropriate HTML tag or a shortcode.


Hooks Settings

  • Add custom HTML code to the <head> tag

For important site-wide scripts

Use this hooks section to add additional meta tags or other important site-wide scripts to the <head> section of your site. Anything added to this field will be served site-wide on page load.

You do want to use this setting for things like your Google Site verification HTML meta tag, or a Pinterest domain verification HTML tag.

❗ You don't want to use this setting for CTAs, affiliate messaging, images, or anything else that you want your user's to see.

  • Add custom content after the page header and menu

For important site-wide messages

Anything added here will be displayed on all posts and pages, including your Home, Feed, and Category pages. This field supports HTML markup and shortcode.

The content placed in this Hooks section will appear after the menu and before the page title:

  • Add custom content between the post heading and the post content

For important in-post messages

Anything added here will be displayed just before the content on posts only. This content will not display on pages or article feeds.

You would want to use this hooks section for things like affiliate disclaimers, CTAs, or anything else you might want your visitors to see at the top of all of your posts. This field supports HTML markup and shortcode.

The content placed in this Hooks section will appear after the post meta information and before the post content:

  • Add custom content after the post content

For supporting in-post information

Anything added here will be displayed just after the content on posts only. This content will not display on pages or article feeds.

You could use this hooks section for CTAs or anything else you might want to see at the bottom of all your posts. This field supports HTML markup and shortcode.

The content placed in this Hooks section will appear after the comments:

  • Add custom HTML code to the end of the <body> tag


For supporting site-wide scripts

You would use this hooks section for additional scripts that might be required by external services such as newsletters or email opt-in forms. Anything added here should not be needed at the time of the First Contentful Paint (FCP).

In other words, this script area is not for important scripts such as your Facebook Pixel, Ad Script, or other scripts needed at the time that the page loads.

Anything added to this field will be served site-wide, just before the closing </body> tag of all posts and pages.


Did this answer your question?