Tags in WordPress are actually only intended for posts - just like categories. A pity, because "tagged" pages are actually useful in some cases.

Why tags for pages at all?

Tags for pages make sense especially if you don't run a pure blog with WordPress, but satisfy the most different user intentions in different areas, and want to link them with tag pages. This is not only good for internal linking, but also holds ranking potential for many short-tail keywords. Ranking potential and usability can be increased if the Tag pages individually with description and Co ...to your needs. This turns them into potent landing pages from which users are redirected to URLs of different types and categories.

Activating tags for pages: the possibilities

As so often with WordPress there are exactly two basic ways to realize a project: manually (in code) or via plugin.

Adaptation of the functions.php

To activate keywords for pages in WordPress, all you need to do is enter the following code in the functions.php your Themes to insert:

// add tag support to pages
function tags_support_all() {
register_taxonomy_for_object_type('post_tag', 'page');
}

// ensure all tags are included in queries
function tags_support_query($wp_query) {
if ($wp_query->get('tag')) $wp_query->set('post_type', 'any');
}

// tag hooks
add_action('init', 'tags_support_all');
add_action('pre_get_posts', 'tags_support_query');

Activate tags for pages via plugin

As an alternative to variant #1 you can use a plugin like Add Category to Pages to fall back on. As the name already suggests, you can easily activate categories for pages.

About Christian

My name is Christian and I am co-founder of the platform fastWP. Here in the magazine I am responsible for the more "technical" topics but I like to write about SEO, which has been my passion for over 10 years now.

2 thoughts on “Tags / Schlagwörter für Seiten in WordPress aktivieren”

  1. Hello, Christian,

    i have installed the recommended plugin "Add Category to Pages" and it works fine. But unfortunately the keywords of the pages are not recognized by the Gutenberg widget "Keyword Cloud".

    What can I do to realize a page search via keywords?

Leave a Comment

Your email address will not be published. Required fields are marked *

en_GB