The reason for this is that WordPress searches for matches using LIKE %post%
, meaning that any post (that is Post, Page or custom post type object) that contains post
in it’s title or content is found.
You can alter this default behaviour by using the posts_where
action hook.
add_action( 'posts_where', 'my_alter_search_where' );
function my_alter_search_where( $where ){
global $wpdb;
if (is_search()) :
$where.= " AND $wpdb->posts.post_content NOT LIKE '%poster=%'";
endif;
}
The only caviat here is that if your post content contains both %post
and %poster="%
as two seperate occurances, it will not be included. There are ways around this, but I’d need to know more about your query, so if this answere is acceptable I’d suggest posting that as a seperate question.
Related Posts:
- How to make search engine index PDF files? [closed]
- How to override normal WordPress search in Buddypress? [closed]
- Search and replace text across all posts
- How would implement StackExchange ‘Questions with similar titles’ for the FAQ on my wordpress site
- dynamic page not indexed
- How to get posts by content?
- WP-PageNavi plugin doesn’t work with multiple pages of search results
- Problem with Search Results in WP (not displaying the full posts)
- How to improve WordPress search
- Creating search filter through plugin
- How do I add advanced custom fields / meta fields to Elasticsearch? [closed]
- plugin to search entire posts, blogs, forum, users [closed]
- Automatically adding category filter based on search string
- How can I reuse the WordPress search form for a custom plugin / widget?
- Custom Taxonomy Tag Search
- What causes an Unexpected HTTP Error within install plugins?
- What is the best way to mimic a search query within a plugin
- Is there a way I can find wordpress posts that don’t contain a word?
- Search is not working on plugin directory
- Search Everything plugin integration
- AJAX search posts and pages
- Search for categories
- AJAX search as you type? [duplicate]
- WooCommerce search products between price range using WP_Query
- Send admin an email when a user’s search has no results
- Integrate Algolia to WordPress site
- How to multiply a post to test internal search results?
- How to set “split_on_numerics” to false in ElasticSearch mapping using ElasticPress? (for proper SKU search in WooCommerce) [closed]
- Woocommerce Backend Search by Title and SKU
- Search and Filter Plugin – How to disable redirection
- WordPress Multi-Step Product Search
- Search by Attachment ID
- Custom search search does not work?
- Creating a search form and displaying results
- Is it save to replace with in WordPress search form
- WordPress search shows protected content
- Best approach to make all tags searchable by the wordpress search function
- How to search post titles with whole words only, but not the exact word only?
- RSS feeds for specific topics
- How to add the search page link to the anchor tag?
- WC Fix Attributes – ‘Add New’ Not Searchable/Delayed
- How to hide an option from dropdown in filter module
- WP search box on page not finding .PDF files
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- Search results to point to specific section?
- Search in WordPress
- Content disappears when searching with Search & Filter plugin
- How to exclude a part of a page in search results
- Accounting for search terms that may include a space, using SearchWP
- how to add navigation icons in specific template?
- multiple string replace of post’s content for large data
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- How to make wp multisite subdomain exist search
- Remove Url Parameter WordPress
- How can I remove this sidebar from my Search Results page?
- History of page, interval of years
- Include post_date in search
- How to order users alphabetically by name? in plugin UPME
- How to hook into search results template or query?
- Add “selected” class to custom taxonomy dropdown search
- Differentiate attachment pages in search results
- Is there any simple wordpress search template that works with existing searchforms?
- Extend WordPress Search
- how to sort results by last day update at search result in plugin installer?
- Jigoshop search taxonomy
- Strange Search Query Appearing on Google Index – “/?q=Save+Us+From+Berlusconi”
- Dave’s WordPress Live Search only works when logged in as admin
- wordpress Search function is not working
- Multi-step, live updating search
- Can we install 3d product configurator into wordpress
- LiteSpeed cache image Optimization
- How to set an exact search box in tablepress plug-in
- “Donate to this plugin” for WordPress.org Plugin Authors
- When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?
- How can I force a “404 Not Found” error
- Code in theme functions.php faster than with a plugin?
- How to remove duplicate Custom Fields?
- Calling a plugin in theme development
- Installing WordPress only for a separate page – ‘mydomain.com/blog’
- ‘Customize’ button in admin bar for CSS
- Breadcrumb NavXT plugin – exclude ‘home’ page
- Take input from form and pass it to function using a wp-plugin
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Help in using SEO Plugins: SEO Ultimate And Yoast SEO Plugin
- Setting Up PHP Workflow in WordPress
- Can inactive WordPress plugins still load scripts?
- Plugin main file is constantly been fired on every website visit
- Changing the Organize Series Listing Pages
- Way to send multiple values for column to MySQL?
- What’s the right way to implement functions in footer.php
- Getting a list of the published posts
- custom post type get_posts() function not work
- Remove metatag from a particular page
- Plugin JavaScripts Confliction
- Plugin’s required JS not being inserted in my theme
- Display alt text as tool tip on page
- Gravity Forms Salesforce field mapping for custom objects
- Check Plugins in Use by Mutli Site Network
- Plugin with Fatal error
- Plugin to transfer new/updated files from media library in “/wp-content/uploads/” between prod environment and preprod environment?