Get rid of 'most used categories' on "page not found" page

Hi,

How do I get rid of the ‘most used categories’ section on the “page not found” page?

Hello Giggybot,

Please try to use the following CSS code in order to hide (not remove) that widget. You should modify 404.php file in order to remove (not hide) it, please let me know if you would like to know how to do it.

You can add CSS code in DashboardAppearanceCustomizeAdditional CSS (WordPress 4.7 and up). Also you can add CSS code directly to style.css file of your child theme.

body.error404 .widget_categories {
    display: none;
}

Kind Regards, Roman.

Awesome, that worked. What if I also wanted to get rid of the Tags and the Archives on this same page? Can you provide the CSS please?

Also get rid of the search option :slight_smile:

Hello Giggybot,

Please try to use this CSS code instead of previous:

body.error404 #primary .widget,
body.error404 #primary .search-form{
    display: none;
}

Kind Regards, Roman.

Wonderful! One more slight problem. The words on that page says, “Maybe try one of the links below or a search?” yet I removed the search functionality. How would I update the words on that page?

Hello Giggybot,

You can create a 404.php file, put this code inside:

<?php
/**
 * The template for displaying 404 pages (not found).
 *
 * @link https://codex.wordpress.org/Creating_an_Error_404_Page
 *
 * @package Talon
 */
get_header(); ?>
<div class="row">
	<div id="primary" class="content-area col-md-8">
		<main id="main" class="site-main" role="main">
			<section class="error-404 not-found">
				<header class="page-header">
					<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'talon' ); ?></h1>
				</header><!-- .page-header -->
				<div class="page-content">
					<p><?php esc_html_e( 'It looks like nothing was found at this location.', 'talon' ); ?></p>
				</div><!-- .page-content -->
			</section><!-- .error-404 -->
		</main><!-- #main -->
	</div><!-- #primary -->
</div>
<?php
get_footer();

…and put this file into a child theme folder. After that you can remove custom CSS code that I posted above, it won’t be needed anymore.

Kind Regards, Roman.