Smart 404

Automatically redirect to the content the user was most likely after, or show suggestions, instead of showing an unhelpful 404 error.

Author:Michael Tyson (profile at wordpress.org)
WordPress version required:2.6
WordPress version tested:5.6.10
Plugin version:0.6
Added to WordPress repository:07-10-2008
Last updated:24-11-2020
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:68
Rated by:5
Plugin URI:https://github.com/leonstafford/smart-404
Total downloads:113 546
Active installs:2 000+
plugin download
Click to start download

Save your visitors from unhelpful 404 errors!

Instead of quickly giving up when a visitor reaches content that doesn’t exist, make an effort to guess what they were
after in the first place. This plugin will perform a search of your posts, pages, tags and categories, using keywords from the requested
URL. If there’s a match, redirect to that content instead of showing the error. If there’s more than one match, the
404 template can use some template tags to provide a list of suggestions to the visitor.

See the Smart 404 homepage for more information.

Template tags

smart404_has_suggestions

Returns true if there are some suggestions, false otherwise

smart404_get_suggestions

Retrieve an array of post objects for rendering manually.

smart404_suggestions

Draw a list of suggested posts.

Pass the parameter “list” to render suggestions as a list.

smart404_loop

Query posts for use in a Loop. Eg:

<?php smart404_loop(); ?>
<?php while (have_posts()) : the_post(); ?>
    <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    <?php the_excerpt(); ?>
<?php endwhile; ?>

Note that the loop will not display pages correctly, as it is not built to support them. It is recommended that if you use
a loop like that above, do not enable searching of pages.

smart404_get_search_terms

Retrieve an array of search terms used to populate the suggestions list, for use with contextual highlighting, etc.

For support and latest source code, please visit https://github.com/leonstafford/smart-404