Yes, as post_exists("great title")
runs the following SQL:
SELECT ID FROM $wpdb->posts WHERE 1=1 AND post_title="great title"
so there’s no post status or post type restriction.
Check the docs on post_exists()
for more info.
If you want to restrict by post type, you can use:
$found_page = get_page_by_title( "great title", $output = OBJECT, $post_type="page" );
See the docs here.
Related Posts:
- How can I link a CSS file only on single posts?
- Category Template: Need to display different content on first page of archives
- How can I hide tags on a child-category page, if that tag has not been used?
- Conditional Tag for has post [closed]
- static landing page leading to author specific pages w/ “live” content
- why str_replace targeting pages instead just targeting post?
- Changing Post Tag Color Based On Post Count
- Conditional css for custom post type
- show div only if have a related post inside
- marking a post that was sticky on category template
- Need help with hiding an image within a post in a category
- Combining multiple conditional statements [closed]
- Is it possible to Schedule Attachments in WordPress?
- Is post ID number always incremental n+
- post__in for get_posts with a dynamic array
- Create custom page in WooCommerce
- Duplicate posts
- How to hide a post from ‘Recent Posts’ widget?
- Hide add new page button
- get_next_post() not working
- Create a separate JS application for an individual post?
- post_parent is 0 when uploading new files
- custom post type grid with content in lightbox [closed]
- Divide Loop Into Days & Categories
- Search for posts based on their url in the admin?
- “next_posts_link” and “previous_posts_link” display me NOTHING
- Can I set and show “important” post in my blog?
- Contact form 7 post loop [closed]
- WordPress list posts from sub categories
- Disable Jquery UI post tabs
- Need help targeting a custom post type with conditional tags
- Dynamically generate child-URLs for posts or custom posts
- If Specific Post, Link Elsewhere
- What structure should post_content have in the database?
- Comma separated all attached image ID numbers except featured image ID number
- Why orderby=”date” does not support manually changed posts?
- Format the Layout of Images In The Edit Post Textarea?
- Choose whether to automatically add a taxonomy with the same name as the post
- Which WordPress hook fires after post content loaded?
- Enable Comments Box On Custom Post Type
- Get Posts Under Custom Taxonomy
- Integrate OpenStreetMap on WordPress
- how do i add posts-page slug before posts slug in permalinks
- Admin – create custom post status and display above table
- wp_query random post
- Possible to alternate between two loops
- How to get a post’s content? [closed]
- Hide posts belongs to few categories in homepage
- Why does a published post only displays the title and not the content in the site? [closed]
- Counter is skipping post when I still want it visible [closed]
- Every second post different class in blog view
- Get post ID from a link
- Is codex right on deleting post?
- WP text styles not coming through to actual post
- Change post author without using wp_update_post()
- WordPress post page not working properly
- wp_query with ajax
- Programatically adding custom filters to post list
- Is it possible to automatically publish a post once a woo-commerce product is published?
- Post is blank when I click on the link
- Update all posts in a loop everyday
- Retrieve post in AJAX Callback
- Change url-structure for wordpress pages – pages in strucutre not top-level
- Adding JS functionality to the Publish button in wp-admin/post.php
- Get postlist for each category using query_posts?
- Get a term each custom post type
- Remove Featured Image from posts in specific category?
- Why does WordPress search returns same number of results for every search query?
- links to posts not working on homepage
- Posts and order
- Post Templates and Post ID’s
- Nest Next and Previous in a href with class that has a background image
- Override WordPress core post-template.php block template
- how to add tags to post in the Loop?
- Delete media from the post but keep my featured image and post
- Single Post function to display all single post images in a carousel
- Search results for ACF data
- Count singular post views automatically
- Pagination (on the static front page) shows always the same posts
- Loop and output 4 rows of posts on home page
- Loop through all posts showing duplicates
- Embed image in post from external url
- Code works on a page but not in a widget
- List posts of assigned categories in list of all categories on single.php
- Display result of custom form
- How can I choose and change a post title at random from an array when it is published?
- Post/Edit/Delete Post From Frontend… How?
- How to show the posts list into a static page? Problems to use the loop into a static page
- Get post title by Alphabet
- Make a paginated article (for easier reading on mobile)
- WordPress post text starts newline after 93 characters
- new blog post does not appear in blog after publishing
- wordpress taxonomy results
- Deleting first four characters from all Post Titles
- Deleling wordpress posts permanently still have IDs
- wp trim function not working
- Can I get custom post items in select box (dropdown)
- Custom Post-Rename Function Does Not Function in WordPress 6.x
- Import alt text in set_post_thumbnail
- how to change background color of my all post