Title: Throws PHP Errors because $post_id is not defined
Last modified: March 21, 2018

---

# Throws PHP Errors because $post_id is not defined

 *  Resolved [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/throws-php-errors-because-post_id-is-not-defined/)
 * Other plugins often will use the same filter “the_title” in a more generic way,
   without defining the post id. Your main function is requiring the $post_id which
   will end up throwing warnings.
 * The simple fix is to define your $post_id as empty so that it can be passed to
   your function without throwing errors. So, go to the “title-remover.php” file,
   on line 16, the main function, update that line to this:
 * `function wptr_supress_title($title, $post_id = '') {`
 * Then all will be fine.

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

 *  Plugin Author [WPGurus](https://wordpress.org/support/users/wpgurus/)
 * (@wpgurus)
 * [8 years ago](https://wordpress.org/support/topic/throws-php-errors-because-post_id-is-not-defined/#post-10235180)
 * Hi there. I know it’s been a while but I’ve finally fixed this issue.
 *  Thread Starter [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * (@webdevmattcrom)
 * [8 years ago](https://wordpress.org/support/topic/throws-php-errors-because-post_id-is-not-defined/#post-10236494)
 * Great to hear [@wpgurus](https://wordpress.org/support/users/wpgurus/) Thanks!

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

The topic ‘Throws PHP Errors because $post_id is not defined’ is closed to new replies.

 * ![](https://ps.w.org/title-remover/assets/icon-256x256.png?rev=1774737)
 * [Title Remover](https://wordpress.org/plugins/title-remover/)
 * [Support Threads](https://wordpress.org/support/plugin/title-remover/)
 * [Active Topics](https://wordpress.org/support/plugin/title-remover/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/title-remover/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/title-remover/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [Matt Cromwell](https://wordpress.org/support/users/webdevmattcrom/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/throws-php-errors-because-post_id-is-not-defined/#post-10236494)
 * Status: resolved