How to search WordPress for content specifically in title?

To specifically exclude posts with “2024” in their titles using a code snippet, you can add this to your theme’s functions.php file: function exclude_title_posts( $query ) { if ( $query->is_search && !is_admin() ) { $query->set(‘post_title_not_like’, ‘2024’); } } function modify_search_where( $where, $query ) { global $wpdb; if ( $title_not_like = $query->get( ‘post_title_not_like’ ) ) { … Read more

Custom permalink for ‘post’ not working

Here are two ways to fix this: Use a Prefix for Single Posts: Modify your permalink structure for posts to include a prefix specifically for single posts. For example: guide/news/post/%postname%/ This way, single post URLs will look like site.com/guide/news/post/your-post-name/ and won’t match the blog list page pattern. Use a Separate Permalink Structure for the Blog … Read more

editPost without undo entry

Yes, editPost is a wrapper around editEntityRecord which according to the core/data docs takes an options object that supports undoIgnore: options Object: Options for the edit. options.undoIgnore [boolean]: Whether to ignore the edit in undo history or not. While you could use this, generally the need to use it implies a mistake or misunderstanding somewhere, … Read more