Shaun Taylor
Shaun Taylor

Reputation: 972

Too many <title> tags

I have a site here: https://www.idee-creative.co.uk Where I have added custom fields to enable me to add custom page titles and descriptions for SEO purposes.

However, the problem is, Wordpress seems to also be displaying it's own title tag containing the sites title and tagline from the general setting...

The Wordpress title must come in from the tag inside my header.php page (I think anyway).

So, is there a way to remove the wordpress page title and just show the page title I created in custom fields?

The code I use to display the custom field is just:

<title><?php the_field('seo_page_title'); ?></title>
<meta name="description" content="<?php the_field('seo_page_description'); ?>"/>

Thanks

Upvotes: 0

Views: 128

Answers (2)

RAUSHAN KUMAR
RAUSHAN KUMAR

Reputation: 6004

use wp_title() for setting the title of your page as

wp_title( string $sep = '&raquo;', bool $display = true, string $seplocation = '' )

You can get a full reference here Adding Custom Title

Upvotes: 1

TDk
TDk

Reputation: 1059

You should edit the header.php file or modify the title tag within JavaScript (I think). You cannot override the <title> tag within an HTML page by just placing your own after.

Hope that helped =)

Upvotes: 0

Related Questions