Remove Archives from 404 page

I found the 404.php file but am not clear as how to edit it to remove the Archives widget - I don’t have posts, just pages, and there are no archives, and I don’t use the Archives widget on any other page. Can you help me remove it from the 404 Page Not Found page?

many thanks in advance!

The plugin 404page - WordPress plugin makes it very easy to create a custom 404 page. I use this with Shortcode any Widget - WordPress plugin to place widgets like search and custom menu to enhance functionality. You might like this as well, it’s very easy.

Thanks very much Thom for replying. However, all I want to do is remove something from the existing page, I don’t really need an extra plug-in. And I’m afraid I am too much of a beginner to use the Shortcode plug-in - I had a look and I don’t understand any of it!

Can anyone help with editing 404.php?

To remove the archives widget you have to remove the following code from theme 404.php file from line number 49 to 55.


	</pre>

<pre><code>

	' . sprintf( esc_html__( 'Try looking in the monthly archives. %1$s', 'sparkling' ), convert_smilies( ':)' ) ) . '';
	the_widget( 'WP_Widget_Archives', 'dropdown=1&title='.esc_html__( 'Archives', 'sparkling' ), "after_title=$archive_content" );
	?>


That’s brilliant, Movin, thank you so much! Works a treat.

All very best wishes from London and Paraguay.

You are most welcome here :slight_smile:

Let us know if you have any other questions by creating seperate topic for it.

If you’re happy with our service, Please don’t forget to review & rate us in WordPress [Sparkling] Reviews | WordPress.org :slight_smile: