Title: posts_exists() casts error that the function does not exist
Last modified: August 30, 2016

---

# posts_exists() casts error that the function does not exist

 *  [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * (@jemcbade)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/)
 * Huh… Documentation says it exists and I see the function in: post.php
 * When I try to call and use the function, I get an error saying the function does
   not exist.
 * I am trying to use this inside a plugin main file.
 * Help is appreciated 🙂

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

 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/#post-6311548)
 * I believe your are looking for `post_exists()` not `posts_exists()` – That could
   certainly be the issue unless you just had a typo in the title of this thread.
 *  Thread Starter [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * (@jemcbade)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/#post-6311594)
 * Right. And even though I misspelled it here :), that is the function I called:
   post_exists()
 * I copied it right out of the Developer documentation.
 * Thanks!
 *  [Craig Ralston](https://wordpress.org/support/users/craig-ralston/)
 * (@craig-ralston)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/#post-6311595)
 * Can you show how you are trying to use it? Seeing the code and the error message
   will help.
 *  Thread Starter [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * (@jemcbade)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/#post-6311596)
 * I’m using it inside a function that is in the main file of a plugin I am building.
   Pretty simple “textbook” usage as gleaned from the docs:
 * // Query for published listing
    function is_this_name_already_listed( $post_title,
   $content = ”, $date = ” ) { $result = post_exists( $post_title, $content = ”,
   $date = ”); return $result; }
 * I pass in the post title in the form of a string stored inside the variable:
 * $post_title = “Lastname, Firstname” which is the form it is stored inside the
   row of the CPT.
 * Thanks again 🙂

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

The topic ‘posts_exists() casts error that the function does not exist’ is closed
to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 4 replies
 * 2 participants
 * Last reply from: [jemcbade](https://wordpress.org/support/users/jemcbade/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/posts_exists-casts-error-that-the-function-does-not-exist/#post-6311596)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
