How to Remove the Current Item from Your Breadcrumb Trail in Breadcrumb NavXT
Content
One of the most common questions users have about the Breadcrumb NavXT plugin is how to remove the final item from the breadcrumb trail. This is often the title of the post or page a visitor is currently viewing. While this practice is generally not recommended for usability and SEO, there are specific design scenarios where it might be necessary.
This guide will explain why this happens and provide the most effective, upgrade-safe methods to achieve this.
Why the Current Item Appears
By design, Breadcrumb NavXT constructs a trail that leads to and includes the resource the user is currently viewing. The final item in the trail is the current page or post title, which provides important context. The plugin's settings allow for extensive customization of the breadcrumb elements, but the inclusion of the current item is a core part of its functionality.
Recommended Solution: Use the Official Extension
The safest and most reliable method to remove the current item is to use a small, official extension plugin created by the Breadcrumb NavXT team. This approach ensures your changes will not be overwritten when the main plugin is updated.
You can find the extension file, breadcrumb_navxt_remove_curitm.php, on GitHub: Breadcrumb NavXT Remove Current Item Extension.
How to use it:
- Download the raw PHP file from the link above.
- Install it as a new plugin on your WordPress site by uploading it to your
/wp-content/plugins/directory. - Navigate to your WordPress admin dashboard, go to Plugins, and activate the new plugin named "Breadcrumb NavXT Remove Current Item".
Once activated, the current item will be removed from all breadcrumb trails generated by Breadcrumb NavXT.
Alternative Method: Conditional Code Snippet
For developers who need more granular control, perhaps to remove the current item only on specific post types or pages, a code snippet can be added to your theme's functions.php file. This method uses the bcn_after_fill action hook to manipulate the breadcrumb trail array.
Example Code:
function my_prefix_remove_current_item(&$trail) {
// Remove the current item on all single posts and pages
if (is_singular()) {
array_pop($trail->trail);
}
}
add_action('bcn_after_fill', 'my_prefix_remove_current_item');
Important Note: Always use a child theme when modifying theme files like functions.php. This prevents your customizations from being lost when the parent theme is updated. Test this code on a staging site before deploying it to your live environment.
What Doesn't Work
It's important to note that this customization cannot be achieved through the Breadcrumb NavXT settings page. The plugin's FAQ and support threads indicate that manually editing the core plugin files is strongly discouraged, as it will cause problems during the next update.
By using the recommended extension or a carefully implemented code snippet, you can modify the breadcrumb output to fit your design needs while keeping your site maintainable and ready for future updates.
Related Support Threads Support
-
Remove the custom post type title on taxonomy detailpagehttps://wordpress.org/support/topic/remove-the-custom-post-type-title-on-taxonomy-detailpage/
-
[Plugin: Breadcrumb NavXT] Remove 'portfoloio-view' from url in breadcrumbhttps://wordpress.org/support/topic/plugin-breadcrumb-navxt-remove-portfoloio-view-from-url-in-breadcrumb/
-
is the a way to get rid of ?post_type= in urlhttps://wordpress.org/support/topic/is-the-a-way-to-get-rid-of-post_type-in-url/
-
[plugin-breadcrumb-navxt ]-how to remove single post titlehttps://wordpress.org/support/topic/plugin-breadcrumb-navxt-how-to-remove-single-post-title/
-
exclude post typehttps://wordpress.org/support/topic/exclude-post-type-2/
-
[Plugin: Breadcrumb NavXT] Can the plug-in ignore html code in the post title?https://wordpress.org/support/topic/can-the-plug-in-ignore-html-code-in-the-post-title/
-
Post breadcrumb notranslatehttps://wordpress.org/support/topic/post-breadcrumb-notranslate/
-
Removing some unneed postshttps://wordpress.org/support/topic/removing-some-unneed-posts/
-
Move breadcrumbs After Titlehttps://wordpress.org/support/topic/move-breadcrumbs-after-title/
-
[Plugin: Breadcrumb NavXT] "Unpost_tag" crumb for Custom Post Types /w no Tagshttps://wordpress.org/support/topic/plugin-breadcrumb-navxt-unpost_tag-crumb-for-custom-post-types-w-no-tags/
-
Remove breadcrumb link titlehttps://wordpress.org/support/topic/remove-breadcrumb-link-title/
-
[Plugin: Breadcrumb NavXT] Remove 'blog' from tag pageshttps://wordpress.org/support/topic/plugin-breadcrumb-navxt-remove-blog-from-tag-pages/
-
[Plugin: Breadcrumb NavXT] How to remove the Post Title ?!https://wordpress.org/support/topic/plugin-breadcrumb-navxt-how-to-remove-the-post-title/
-
[Plugin: Breadcrumb NavXT] Omitting Specific Words from Breadcrumb Trailhttps://wordpress.org/support/topic/plugin-breadcrumb-navxt-omitting-specific-words-from-breadcrumb-trail/
-
How to edit Pages template to remove word Postshttps://wordpress.org/support/topic/how-to-edit-pages-template-to-remove-word-posts/
-
How removing the page/post name from breadcrumbs?https://wordpress.org/support/topic/how-removing-the-pagepost-name-from-breadcrumbs/
-
Remove post title from breadcrumbshttps://wordpress.org/support/topic/remove-post-title-from-breadcrumbs/
-
Remove breadcrumbs from the read more news pagehttps://wordpress.org/support/topic/remove-breadcrumbs-from-the-read-more-news-page/
-
Hide for Specific Custom Post Typehttps://wordpress.org/support/topic/hide-for-specific-custom-post-type/