OK, I have created a header.php file and have included all my meta data: titles, descriptions, keywords in it and have set it up to swap out each one for each individual page of my website, yet when i check my website for SEO on sites like scrub the web, it comes back with an error that it is not formatted properly or it is not in use at all, wondering if anyone has an idea why.
Each individual page has the following:
<?php include('includes/header.php');?>And the header.php file is set as follows:
<?php #Grabs current page we're on (referenced by globals) $page = basename($_SERVER['PHP_SELF']); #for swapping titles depending on page function titles() { global $page; $titles = array( 'index.php' => 'Home | Company Title | Address | 123-356-1595', 'privacy.php' => 'Privacy Policy | Company Title | Address | 123-356-1595'); return $titles[$page];} #for swapping meta descriptions depending on page function meta_description() { global $page; $metas = array( 'index.php' => 'The index page', 'privacy.php' => 'Privacy Policy for Company'); return $metas[$page];} #for swapping meta tags depending on page function meta_tags() { global $page; $tags = array( 'index.php' => 'Company name, services, etc', 'privacy.php' => 'Company name, services, etc'); return $tags[$page];} ?> <?= titles();?> " /> " />