Title: PHP/JS in post title
Last modified: February 29, 2020

---

# PHP/JS in post title

 *  [reti](https://wordpress.org/support/users/reti/)
 * (@reti)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/php-js-in-post-title/)
 * Look at this page. I would like the title of this post (“12 Cartoons Your Mom
   Shouldn’t Let You Watch When You Were Young”) to be replaced by a description
   of the entry that got the most votes. This entry is: “#1 Meet open lists,” and
   his description is: “Far far away, behind the word mountains, far from the countries
   Vokalia and Consonantia, there live the blind texts.” I thought I’d put PHP or
   JS as the title for this entry, but I can’t do it in WordPress default settings.
   How do I change this?
    -  This topic was modified 6 years, 3 months ago by [Yui](https://wordpress.org/support/users/fierevere/).
      Reason: There is special field for links
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-js-in-post-title%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/php-js-in-post-title/#post-12495178)
 * As you likely discovered, you cannot enter functioning code as a post title. 
   What you can do is hook the “the_title” filter. Whatever your filter callback
   returns will be the title displayed regardless of the actual post title. This
   is assuming your theme displays titles by calling the `the_title()` template 
   tag, which the vast majority do.
    [https://developer.wordpress.org/reference/hooks/the_title/](https://developer.wordpress.org/reference/hooks/the_title/)
 *  Thread Starter [reti](https://wordpress.org/support/users/reti/)
 * (@reti)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/php-js-in-post-title/#post-12503843)
 * Thanks for your answer. I’ll check it out and let you know 🙂

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

The topic ‘PHP/JS in post title’ is closed to new replies.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [title](https://wordpress.org/support/topic-tag/title/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [reti](https://wordpress.org/support/users/reti/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/php-js-in-post-title/#post-12503843)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
