WordPress.org

Ready to get started?Download WordPress

Forums

strip_tags() is not working on the_excerpt() (1 post)

  1. erikcw
    Member
    Posted 7 years ago #

    Hi all,

    I'm trying to use the_excerpt() function to create a meta description tag based on each post.

    The problem is that the_exceprt() wraps the content in <p></p> and also includes any other html formatting added to the post.

    I tried using the php strip_tags() function to remove the tags, but it doesn't seem to be working.

    <meta name="Description" content="<?php strip_tags(the_excerpt()); ?>" />

    Does anyone have any idea how I can get this to work?

    Thanks!
    Erik

Topic Closed

This topic has been closed to new replies.

About this Topic