如何从Yoast和Rank Math插件中的面包屑中删除文章标题?插图

Breadcrumb navigation helps users understand the location of the current article compared to your entire site. In addition, Google and other search engines display it in search results instead of posting URL. Therefore, adding breadcrumbs to WordPress articles is an important part of building internal navigation for your site.

‘s process of adding breadcrumbs to WordPress varies depending on the theme and plug-in you use. If your theme does not provide this functionality, the best option is to use a SEO plug-in, such as Yoast SEO or Rank Math. However, one problem with bread crumbs is that there are long article tiles in the path.

in this article, we will explain how to remove the article title from the breadcrumbs when using the Yoast SEO and Rank Math plug-ins. Article title in

breadcrumbs

by default, your breadcrumb structure displays home page links, categories, and article titles. Typically, you will display the structure above the title of the article, which may cause some problems:

  • this will be redundant because the title appears multiple times above the collapse area.
  • Google does not display the breadcrumb article title in the search results.
  • when your article title is long, it will occupy multiple lines on smaller devices.

‘s solution here is to remove the repeated titles from the breadcrumbs, which looks simple and takes up less space.

Remove the article title from Yoast SEO bread crumbs

lets us first explain how to remove the title from the breadcrumb in Yoast SEO, and then show you how to do it in the Rank Math plug-in.

Yoast does not provide any default options for this, and you can do this by adding the following code to the theme’s functions.php file.

  • goes to the appearance & gt; theme Editor menu in the administrative dashboard.
  • ensures that your current theme is selected from the Select theme to Edit drop-down list, and then click the Select button.
  • selects the functions.php file from the list of files displayed in the right sidebar.
  • adds the following code at the bottom of the file.
  • clicks the Update File button to save your changes.
/* Remove Post Title from Yoast Breadcrumb */
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;
}

it should look like this in the theme editor. Many topics, such as

如何从Yoast和Rank Math插件中的面包屑中删除文章标题?插图1

inserting code

Astra into the functions.php file, can automatically integrate Yoast breadcrumbs into the layout of your site through customizer settings. Whether you use theme settings or manually insert PHP code to enable breadcrumbs, adding the above code to the theme’s functions.php file removes the title. The result will be shown in the following figure:

如何从Yoast和Rank Math插件中的面包屑中删除文章标题?插图2

removes the article title from the Yoast breadcrumbs

because the changes will be deleted when the theme is updated, so be sure to use the subtopic and update the subtopic’s functions.php file. Alternatively, use a plug-in such as Code Snippets to insert functions without editing the theme file.

Delete the article title from Rank Math bread crumbs

Rank Math is another SEO plug-in that provides Yoast-like functionality. You must manually insert the code into the single.php or header.php file to enable breadcrumbs from the Rank Math plug-in.

, however, the good part is that you don’t need to modify the functions.php to delete the article title. As part of the plug-in settings, you can use an option.

  • goes to the Rank Math & gt; General Settings menu and navigates to the Breadcrumbs section.
  • scrolls down and finds the “Hide Post Title” option and enables it.
  • clicks the “Save Changes” button for the changes to take effect.

如何从Yoast和Rank Math插件中的面包屑中删除文章标题?插图3

hides the article title in Rank Math’s breadcrumbs

now, check the breadcrumbs in the published site, and you won’t see the article title.

Disclaimer: All articles on this website, unless otherwise specified or marked, are original and published on this website. Any individual or organization is prohibited from copying, stealing, collecting, or publishing the content of this site to any website, book, or other media platform without the consent of this site. If the content on this website infringes on the legitimate rights and interests of the original author, you can contact us for assistance.