404 Error Contact Form 7 on WordPress

this is quite a common issue with htaccess file blocking malformed un-shlashed url such as cf7 wp-json requests. Therefore check your .htaccess file in your root folder to see if this is the case with your server too, find the section in your .htaccess that is adding a “https://wordpress.stackexchange.com/” at the end of requests # … Read more

Should the actual /category/ directory be 404? Is that normal WP behaviour

Yes, it’s normal behavior. WordPress uses a set of rewrite rules to process requests. Here are the rules that will match requests related to categories: [category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] [category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2] [category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2] [category/(.+?)/?$] => index.php?category_name=$matches[1] As you can see, all of them require, that the request is longer than /category/. And it makes … Read more

Exclude JS file from 404 error page

There is is_404(). I normally use it to do just the opposite, to add CSS and JS animations which are specific to the 404 error page. In your case that would be: function wpse_339946() { if ( ! is_404() ) { wp_enqueue_script( ‘tracking-js’, get_template_directory_uri() . ‘/js/tracking.js’ ); } } add_action( ‘wp_enqueue_scripts’, ‘wpse_339946’ );