There is no excuse for modern businesses not to have a blog or some version of one. Constantly updated content is key to your ranking on Google and will provide your customers with more information about your company or product. When Google indexes a page, it needs to know what to show the search user as a title or they won't click on it.
Why use dynamic page titles?
Page titles are VERY important because it's what the search user bases their decision on which link to visit. If every single blog post of yours says "Marketing Company - Blog" then users will be much less likely to view/link to that blog posting than if the page title said, "10 Strategies for Effective Marketing in Lynchburg, Virginia" Your titles need to be specific.
How do I dynamically create a page title?
The first thing you will want to do in this tutorial is copy all of text in your <head> section into a PHP file called "header.php". The file should look something like this:
If we were to use this as is, every page would have the page title: "My Business Name". We want to dynamically generate this page title so we will replace the text between the "<title>" tags with some PHP code:
This will set the default title as "My Business Name" but also allow us to change the page title if we would like. Now go into each one of your pages and replace the <head> section with the following code:
Make sure that each file that you do this to is a PHP file (ex. filename.php). Now all you have to do is change the "Page Title Here" text to the name of that page. If it's the contact page, change the text to: "Contact Us | My Business Name" or whatever you would like.
For blog posts, you can dynamically create the title of the page in our MySql Query like this:
This will make your web pages more searchable and users more likely to visit your specific article.