Site logo

[Resolved] Remove article title from breadcrumbs

Home Forums Support [Resolved] Remove article title from breadcrumbs

Home Forums Support Remove article title from breadcrumbs

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1696529
    Rob

    A while ago I successfully added breadcrumbs to my GP theme and I was happy with the way they appeared.

    However, about 6 weeks ago the title of the blog posts started appearing in the breadcrumbs, as shown below:
    https://robpowellbizblog.com/wp-content/uploads/2021/03/remove_breadcrumbs.jpg

    This is annoying as it duplicates the existing article title (it could also be viewed by search engines as an attempt to spam the search results).

    My question is: how do I edit the breadcrumb code so that the title of the article does not form part of the breadcumb?

    Thanks for your help,

    Rob

    #1696555
    Elvin
    Staff
    Customer Support

    Hi there,

    Aside from the current question, the breadcrumbs actually duplicate twice as shown here:
    https://share.getcloudapp.com/DOu2Ob4g

    One added on the supposed div where the title should’ve been added and one within the Thrive Editor.

    Can you tell us how the Breadcrumbs is inserted? So we have an idea of how the breadcrumb is structured/generated.

    Let us know.

    #1696584
    Rob

    Thanks for the reply.

    That second duplication was the result of me testing a shortcode, which I’ve now removed:
    https://robpowellbizblog.com/quizzes-for-lead-generation/

    I can’t remember exactly where I added the code for the breadcrumbs. Is there an ‘inspector tool’ where you can hover the mouse over the element and it will tell you where the code snippet is (i.e what the WP file is that contains the code)? If so, that is what I would need in order to work out where the code is.

    This is the GP element that I am using as the ‘hook’:
    https://robpowellbizblog.com/wp-content/uploads/2021/03/GP_Elements.jpg

    Thanks for your help,
    Rob

    #1696595
    Elvin
    Staff
    Customer Support

    I can’t remember exactly where I added the code for the breadcrumbs. Is there an ‘inspector tool’ where you can hover the mouse over the element and it will tell you where the code snippet is (i.e what the WP file is that contains the code)? If so, that is what I would need in order to work out where the code is.

    While we can inspect the page and find clues, there are occurrences when the element gives too little to be able to actually identify which code it’s coming from. (no classes, no HTML comments)

    But here’s a quick fix to your concern.

    We can actually just hide the title on the breadcrumbs from displaying through CSS.

    Try this:

    strong.breadcrumb_last {
        display: none;
    }
    #1696598
    Rob

    I added that CSS and it has fixed the problem with the duplicated title in the breadcrumb:
    https://robpowellbizblog.com/wp-content/uploads/2021/03/breadcrumb_problem_fixed.jpg

    Many thanks 🙂

    #1696600
    Elvin
    Staff
    Customer Support

    Nice one. Glad you got it sorted.

    #1696601
    Rob

    Thanks, all resolved now 🙂

    #1749711
    Charles

    I pasted this into my simple css plugin which I thought would activate it but it did not remove the title from my Yoast breadcrumbs.

    Thanks.

    strong.breadcrumb_last {
    display: none;
    }

    #1749713
    Charles

    I’ve seen this as a proposed solution to removing the title as well but I don’t think it’s CSS so I don’t know if it’s safe to use it.

    /* Put in myfunctions.php
    * Remove the last breadcrumb, the post title, from the Yoast SEO breadcrumbs
    * Previous breadcrumb will remain linked
    * Credit: David @ https://generatepress.com/forums/topic/how-to-hide-the-title-part-in-the-breadcrumb-im-using-yoast-seo/#post-614239
    * Last Tested: Apr 11 2020 using Yoast SEO 13.4.1 on WordPress 5.4
    */

    add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ );
    function remove_breadcrumb_title( $link_output) {
    if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) {
    $link_output = ”;
    }
    return $link_output;
    }

    #1749728
    David
    Staff
    Customer Support

    Hi Charles,

    That second snippet is PHP – this article explains how to add the code to your site:

    https://docs.generatepress.com/article/adding-php/

    TLDR: If you’re using a Child Theme then add the code to the Child Themes functions.php file – if you’re not using a Child Theme then install the Code Snippets plugin, add a new Snippet and paste the code in and save it.

    #1749841
    Charles

    Neither seem to remove the title from my crumbs.

    #1749888
    Leo
    Staff
    Customer Support

    That’s a YoastSEO filter so you will need to check with their support on why it’s not working.

    #1749922
    Leo
    Staff
    Customer Support

    I can’t really comment on what’s the best option as it’s more about personal preference.

    Please make sure to reply to the forum topic here and start a new topic if you need further help with this.

    Thanks!

    #1771087
    Cristina

    Worked for me when I removed .strong leaving the css code to:

    .breadcrumb_last {
    display: none;
    }

    #1771483
    Leo
    Staff
    Customer Support

    Thanks for sharing!

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.