wordpress check if post exists by id code example Example: check if post id exists wordpress post_exists(get_the_title($postID)); //returns $postID or 0