Within the loop you can output the post only if it does not match your banned words
<?php
while ( have_posts() ) : the_post();
$banned = array('badword', 'http://');
$ok = true;
foreach ( $banned as $value ) {
if ( stristr( $post->post_content, $value ) ) {
$ok = false;
}
}
if ( $ok ) : ?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<?php endif;
endwhile;
?>
Related Posts:
- How do I set the default admin sort order for a custom post type to a custom column?
- Delete all posts of a custom post type—efficiently
- Create category only for custom post type
- Reducing the use of global $post
- Custom Post Types not showing on Custom Taxonomy archive page
- custom post type or taxonomy
- is_singular() not working if called via callback function of admin-ajax.php
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Search everything (posts, pages, tags, cpt, meta)
- Admin to user notices – best practices?
- Reslug a Custom Post Type
- Removing CPT slug from URL results in 404 error for archive page
- Internationalize / translate custom post types & taxonomies
- front end radio custom taxonomy with custom post type
- Search Post Title Only [duplicate]
- Custom post type’s slug gets wrong when adding a custom meta box
- How to add meta boxes(repeater fields) from WordPress back end?
- Displaying Meta Box Image
- Admin List Dynamic Heading
- Beginner question: Accessing functions.php through admin web interface in order to import custom post types?
- How can i list custom post type categories?
- Query Custom Post by Category
- Custom post type routing with hierarchy
- Role Capabilities: Add New Ones?
- Custom Permalink with Dynamic Taxonomy for Custom Post Type – Works, but breaks other permalinks
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- Custom post type capabilities require “create_posts” to access the edit posts list page
- Custom post type with slug for plural (archive) and for single
- Custom post type archive not regarding ‘posts_per_page’ => -1
- If post_type is This or This
- Add category in post type dynamically
- Shortcode insertion in tab
- Group custom posts by custom taxonomy names
- Using GraphQL Plugin with Pods Framework
- Use regular category with custom post types
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- can’t see custom post content filtered under “mine” filter in admin panel
- Custom post type not showing in search result
- Listing posts under primary and secondary taxonomies
- Removing Custom Permalink Structure for Custom Post Type
- Settings API – save multiple tabs at once
- Set template for custom post type?
- How do I display a list showing custom post types nested within a taxonomy?
- How to create multiple editor?
- make permalink go to a custom single.php file
- Make custom post meta sortable front end
- $wpdb->get_col and ORDER BY?
- get_post_types – exclude multiple post types by name
- Custom post type loop with custom category filtering
- Check if user has comment on current post
- How to show all taxonomies within custom post type loop
- Showing taxonomy terms on custom post type
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Get admin area editor in frontend
- If meta_value of meta_key is less than today’s date update meta key
- How to list custom post types on a custom post type page?
- Using WP_Query, I want to show posts that are associated with a custom taxonomy term
- Meta box with front-end styling
- Permalink Trouble with custom post types
- Shortcode in pages or tempate files for custom post type
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Show posts associated with ACF post object and custom post type
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- “Author” custom post type
- Custom fields array to display it monthly
- How to show the post which checkbox is not selected
- WordPress next post by ajax call on button click
- Custom post type query with taxonomy
- How do i enable categories for my custom post type?
- Modify default Related Posts Code to Custom Post Type
- Custom Post type shortcodes
- WordPress custom post type post item data – show/fetch only on click with Javascript dynamically?
- Display CPT taxonomies as an archive page
- How can I use a custom template to load custom post type posts based on a post_meta value
- filter using custom fields
- Displaying Custom Fields from Custom Post Types [closed]
- CPT – Custom Text fields point to new url permalinks
- Templates for CPT not working
- Register post type getting error 404
- Add tags to a “pending” post before publishing
- yet another: custom post type with pagination not working in WordPress
- Render the metabox input values as HTML
- Cannot use pages created on WP
- How to display most visited posts of a certain category of custom post type?
- How to use TOC with ACF?
- Tricky Custom post loop
- Add “post option” support parameter in custom post type using Hueman Theme?
- Insert custom post data in to MailChimp campaign email
- how can i hook multiple post type in single
- Stop header code from showing in category page?
- Two blogs on same WP website
- Pagination not working for archive
- Two post types with same single template
- Save post_parent in a custom post type
- Posts structure named to blog, how to add month and year
- How to change post cpt with submit button?
- Filtering custom post types using category taxonomy
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to use wp_set_object_terms depending on page ID?