Error: Cannot redeclare yoast_breadcrumb()

If you’re getting a breadcrumb error that looks like this:

Cannot redeclare yoast_breadcrumb() (previously declared in /home/require/public_html/wp-content/plugins/wordpress-seo/inc/wpseo-functions.php:96) in 

Your theme or another plugin is including our breadcrumbs class, and not properly wrapping it in class_exists or function_exists wrappers. The <path> part of the error above should normally point you at either a themes or plugins directory, telling you which plugin or theme is the culprit.

The breadcrumbs class in our plugin is maintained, whereas the breadcrumbs class shipping with your theme is probably out of date, contributing to the breadcrumb error. So check with the creator of your theme and send them to this page.

I created the theme, what should I do to fix this error?

You should wrap the class and functions in class_exists or function_exists wrappers. Alternatively, rely on the Yoast SEO plugin and use the breadcrumbs provided by our plugin. The breadcrumbs are up-to-date and work with custom post types, custom post type archives, etc.

Did this article answer your question?

Thanks for your feedback!

Related articles

Get free SEO tips!