WordPress.org

Ready to get started?Download WordPress

Forums

How to Filter Tags from the_tags() (2 posts)

  1. Mike Olaski
    Member
    Posted 1 year ago #

    Hi,

    I use some tags for internal purposes that I would like to exclude globally from the_tags or any function that lists tags on the site.

    I have found some old solutions, but would like a modern one for 3.4.2.

    Thanks,

    Mike

  2. Peter_L
    Member
    Posted 1 year ago #

    You'll definitely need one of these tag parameters
    tag_id or tag__not_in
    http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters
    I see 2 solutions:

    The correct one which is a bit too complex for me would involve adding a filter to all your queries, automatically removing (filtering) the tags from the query.

    Solution 2: manually excluding this tags from all your queries. By this I mean adding the negative tag query to all the queries in all your template files.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags