• Resolved sultanes

    (@sultanes)


    Hello! How to remove site names from the end of the title in bulk?
    for example: <title>How to remove the site name from the post title? – DeleteSiteName.com</title>
    Editing each page and removing one by one takes a lot of time.
    is there any php code for the yoast seo plugin, Version 24.2

    • This topic was modified 1 year, 2 months ago by sultanes.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @sultanes

    You can use the filter wpseo_title to change the title. We have a developer portal with more information about filters and many examples of how to implement them.

    Typically code snippets are added to your theme’s functions.php file. If you’re unfamiliar with using code snippets, we’d like to refer you to the WordPress documentation on how to use a filter.

    We recommend creating regular backups of your site and database for your site’s health and safety. A backup is crucial before making important changes on your website and provides you with a safety net if something were to go wrong. Learn more about the benefits of regular backups.

    Thread Starter sultanes

    (@sultanes)

    I don’t understand any code, please give me a ready-made PHP code to remove site names from Title. Thank you!

    Thread Starter sultanes

    (@sultanes)

    solves this problem YOAST SEO

    add_filter(‘wpseo_title’, ‘my_wpseo_title’);
    function my_wpseo_title($title) {
    $title = str_replace(‘ – SiteName.com’, ”, $title);
    return $title;
    }

    • This reply was modified 1 year, 2 months ago by sultanes.
    • This reply was modified 1 year, 2 months ago by sultanes.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How to remove the site name from the post title?’ is closed to new replies.