skip to Main Content

I have a tourism site and I want to change the title

The site title is now displayed as follows :

“Activities | San Francisco, USA | My Website title”

to :
“Activities San Francisco, USA | My Website title”

This code is in the template

<title> <? php wp_title ('|', true, 'right'); ?> </title>

thanks for your help

2

Answers


  1. Remove the seperater from the parameters. Chnage the function to this:

    <title> <?php wp_title('', true); ?> </title>

    Login or Signup to reply.
  2. The recommended way to set a title is using add_theme_support(‘title_tag’). This has to be added to the functions.php file. Then use wp_head() inside tags. Using wp_head(), auto generates the page title in WordPress. Then you can use a filter document_title_parts to filter the auto generated title of your wordpress pages. Of course you can use condition logic in side the document_title_parts filter.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search