Title: Filtering Titles?
Last modified: August 19, 2016

---

# Filtering Titles?

 *  [Tom Belknap](https://wordpress.org/support/users/dragonflyeye/)
 * (@dragonflyeye)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/filtering-titles/)
 * Forgiveness to all if I’ve not looked deeply enough, but this is rather strange.
   I’m [looking here](http://codex.wordpress.org/Plugin_API/Filter_Reference#Post.2C_Page.2C_and_Attachment_.28Upload.29_Filters)
   and not seeing what I’m supposed to. I could be out of my mind, though. . .
 * I have a plugin which will filter the title of a post, but what I’m finding is
   that I’ve had to put in two filters, the_title for the title as it appears within
   the page and single_post_title for the title as it appears within the HTML `<
   title>` tags.
 * Is there another, more convenient way to do it? I need this to happen on display
   as a filter, not on database save, as the page will change based on user input(
   its a user profile page plugin).
 * Thanks in advance!!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Tom Belknap](https://wordpress.org/support/users/dragonflyeye/)
 * (@dragonflyeye)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/filtering-titles/#post-878695)
 * w00t! Worse than I thought: the filters I’m using are converting all page and
   post titles on the page, when they’re only supposed to change the current one.
   Anybody have any ideas?
 *  [kerkness](https://wordpress.org/support/users/kerkness/)
 * (@kerkness)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/filtering-titles/#post-878957)
 * You can check if the title you’re filtering belongs to the current post by comparing
   it to the global $post->post_title variable.
 * Here is an example filter
 *     ```
       function my_title_filter($title)
       {
       	global $post;
       	if( $title == $post->post_title ){
       		$title = 'My New Filtered Title';
       	}
       	return $title;
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filtering Titles?’ is closed to new replies.

## Tags

 * [the_title](https://wordpress.org/support/topic-tag/the_title/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [kerkness](https://wordpress.org/support/users/kerkness/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/filtering-titles/#post-878957)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
