Head (WordPress)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

The head part of an HTML document, contains metadata like author, description, links to CSS- and JavaScript files, etc. This is also the place where you used to put meta tags.

What kind of metadata?

This list won't be exhaustive:

hreflang - Per page

  • hreflang statements go in the head → hreflang
  • Typically an individual snipper for each page. However, this can be mass-generated through a simple algorithm.

Structured Data - Per page

  • Structured data is typically pust in the head of a site → Structured Data
  • A snippet typically applies to only one specific page.

On every page or one page?

Two cases:

  • Stuff that is put in the head of every page of a site → Theme KBO 2019: KBO options » Code and vendors » Head
  • Stuff that is put in the head of a specific site → ?

Google Tag Manager

One approach to put stuff in the head, is through Google Tag Manager (gTM). On one hand, this is an easy approach, on the other hand, it has some drawbacks:

  • Heavy: Like shooting a mosquito with a gun. Maybe a better approach: Through a plugin or through the theme
  • Some themes load gTM stuff late in the site-loading process, and that might distort its function.

See also

Sources