404 error on all pages but homepage

Assuming you are on Linux, you need to make some changes in apache2.conf file stored in /etc/apache2 directory. Open the file with root permissions, you will find the code given below in the file. <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> Here just change the AllowOverride None to AllowOverride All, save … Read more

How to remove CPT comment feed from head?

Following command hides comments feed for posts (WP 4.4+ required!), but custom pages still have comments feed displayed, even if comments are disabled for such page: add_filter( ‘feed_links_show_comments_feed’, ‘__return_false’ ); To resolve this, I had to add this addidtional code too: function remove_comments_rss( $for_comments ) { return; } add_filter(‘post_comments_feed_link’,’remove_comments_rss’);

404 error after publishing a post

I just ran into something similar to this. It had to do with refreshing permalinks. If you go to Settings -> Permalink and just click save see if it fixes your problem. It did for me. In the end I added the following to my functions.php file which updated the permalinks for me. I was … Read more

Non “WordPress” pages/code getting 404 error

The problem your having is because of the way the WordPress rewrite system works. The WordPress .htaccess sends all requests (that dont actually exist except index.php) through the index.php file in the WordPress root directory. If any request is made for a file named index.php it will also get sent through the root WordPress index.php. … Read more

WP-admin giving 404

Since you rename the original plugin folder and create a blank plugin then it works. If in case log file is not immediately reflecting the error or it is not obvious for identifying the error. Moving the disabled plugin one by one to the new empty plugin folder is another way to find out which … Read more

WordPress monthly archive links result in 404

It looks like you need to add your news custom post type to the query for archive pages (I had the same problem). Codex: custom post types to query Add this code to your functions // Show posts of ‘post’, and ‘news’ post types on archive page add_action( ‘pre_get_posts’, ‘add_my_post_types_to_query’ ); function add_my_post_types_to_query( $query ) … Read more

How do I redirect all 404 errors of a specific post type to another URL?

It looks like template_redirect is as far up the WordPress action chain you can go while still being able to detect that a 404 error is being thrown. This action will trigger before any template files would be loaded so it will happen before loading unnecessary resources. You can try adding this into your /wp-content/themes/yourtheme/functions.php … Read more