How to change the "-" sign into pipe sign "|" in WordPress title?

I want to change the WordPress title separator sign (-) into pipe sign (|). Can anyone tell how to do this?

1 answer

  • answered 2018-11-08 07:28 Tristup

    To replace the '-' with '|' you can follow the below steps :

    1. Find remove add_theme_support( 'title-tag' ); (it may be in functions.php after_setup_theme hook )
    2. add <title><?php wp_title('|',true,'right'); ?></title> in header.php
    3. For setting POST_NAME | BLOG_NAME, this one line code should be great <?php wp_title('|',true,'right'); ?> <?php bloginfo('name'); ?>

    To know more visit the link