Support » Plugin: Surbma | Yoast SEO Breadcrumb Shortcode » Breadcrumbs Shortcode Executing in Post Excerpts Found in Search Results

  • Resolved maxxskywalker


    When I run a search query on my site via the searchbar I put into the topbar, sometimes I get results coming from the breadcrumbs that I have on some of my static pages.

    From what I can tell, it’s still executing the shortcode within the post excerpt, but instead of printing the page title, like it should for the page it belongs to, it’s printing the archive title, which includes the search term.

    For example: Home / Search Term: “particulate”

    Refer to this image, if you’re having trouble understanding my issue:

    At this time, I can’t really tell if its adversely affecting my search results, but it’s a concern I felt you should be made aware of. I can imagine that if I had your breadcrumbs plugin on all my blog posts, and other custom post types, I would have the same problems in my other post archives.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Surbma


    Hi @maxxskywalker,

    it is a very interesting situation. You need to understand how shortcodes are working and think about how do you want to insert the shortcode into your posts and pages.

    I see, you are using Divi theme and also the Toolset Types and Views plugin. You have put the shortcode into a Divi section, so the shortcode is part of the content.

    My first suggestion would be to modify the search results page, that you already manage with Views. So you can set to show the excerpt or any other custom post field on the result page. This way, the shortcode won’t be there.

    Or you can use custom code to conditionally insert the breadcrumb into your pages.

    I’m thinking about a new version, so there would be options to choose, where you want to place the breadcrumb. But it is just a plan now.

    Thread Starter maxxskywalker


    Ah, because the shortcode is in the post body, it shows up in the excerpt. Makes sense. Because of the way Divi is designed, it’s kinda required that I have the shortcodes where they are to be consistent with the rest of the site.

    We’ve figured out a Toolset based solution using conditional logic that seems to work.

    [wpv-conditional if="( is_archive() ne '1' )"][yoast-breadcrumbs][/wpv-conditional]

    Thanks for your quick response, though.

    Plugin Author Surbma


    Very good idea and solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Breadcrumbs Shortcode Executing in Post Excerpts Found in Search Results’ is closed to new replies.