Remove trailing /feed from permalinks that use a .html suffix

You can achieve this by adding the code to .htaccess file of your apache server. RewriteEngine On RewriteCond %{REQUEST_URI} ^/([0-9]{4})/([0-9]{2})/([^/]+)\.html/feed/?$ [NC] RewriteRule ^ /%1/%2/%3.html [R=301,L] The given code will helps you in set up a redirect so that any request to a post URL with /feed appended will be redirected to the original post URL … Read more

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

Bypass fetch_feed cache

SimplePie does not necessarily use the exact feed URL that was passed to fetch_feed() – see SimplePie::get_cache_filename(), but yes, WordPress adds the feed_ prefix to the transient key. So you can instead try using the wp_feed_options hook to get the correct transient key and then delete the existing transient. $bypass = $this->bypass; add_action( ‘wp_feed_options’, function … Read more