Support » Themes and Templates » Remove Tags from the_content output

  • Resolved moonwizard



    I’m using a theme which uses the the_content() function to show the content of pages.

    This line of code also shows me the page tags.

    Can I remove or hide the tags from the the_content output?

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael


    Forum Moderator

    the tags are likely displayed using ‘the_tags()’
    find this in your code and delete it.

    always make a backup copy before editing theme files

    Try using the PHP strip-tags() function.


    Sorry I think I haven’t explained myself clearly.

    I can see clearly that at the end of my page the tags are shown because when I comment out the the_content() line, both tags are content are not showed anymore.

    This is the code in my “page.php”:

    <div class="post" id="post-<?php the_ID(); ?>">
                            <h1 class="title"><?php the_title(); ?></h1>
                            <?php post_slide_show(); ?>
                            <?php the_content(); ?>
                            <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
                            <div class="clear"></div>
    						<?php edit_post_link(__('Editar aquesta entrada'), '<p>', '</p>'); ?>

    I don’t see the the_tags function anywhere.

    Am I completely lost?

    Thank you!!



    Forum Moderator

    a link to your page might help.

    Here you have an example:

    As you can see, at the end of the content, the tags are shown. I want to hide tags. They confuse the visitor.

    Your help is really appreciated. Thank you!


    Now the tags are gone. This was due to Headspace plugin, which was publishing the tags inside the main content.

    The solution is really easy, although it has taken me some days to notice it: just deactivate the option “Force tags in posts” and “Force tags in pages” and that’s all.

    Hope it helps somebody anytime. Thank you for your help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove Tags from the_content output’ is closed to new replies.