skip to Main Content

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

2

Answers


  1. 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 =)

    Login or Signup to reply.
  2. 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

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