1

I always make a footer and a header and include them in my php pages but I am not sure the impact of doing this for SEO.

The header has only a main banner and the navigation menu, all the metatags including page description are unique to each page.

So if I made just one header file and one footer file to php include on all pages , does it affect SEO?

4
  • Are you saying that all your title, description tags/meta-tags will be identical? – closetnoc May 27 '14 at 21:16
  • @closetnoc, no, au contraire, description and meta tags are unique to each page. The header will contain only a banner and a navigation menu, the footer will have a site map and copyright info. – Nicoli May 27 '14 at 21:21
  • I see that John has you covered. I was just checking so that I knew how to answer your question. – closetnoc May 27 '14 at 22:04
  • Anytime! I knew you were in good hands with John. – closetnoc May 28 '14 at 15:30
5

No, this will not affect you. PHP is processed on the server side and then it sends out HTML to the user agent. In this case the user agent is Google. So all Google sees is the HTML of your pages. It doesn't know nor care how you generate your pages.

2
  • So the same applies to dynamic links modified via .htaccess, using RewriteRule, right? – Nicoli May 27 '14 at 21:35
  • 1
    Yes. They see what the user sees. – John Conde May 27 '14 at 23:35
0

Including a php script will not affect your seo directly, but a lot of IO, processing, database acess from the disk or a bad script running slow included on your page, may slow your page down and it will hit the page's optimization for the bad

0

While John is right, I do want to add that website loading speed is a factor in SEO.

Using just a basic include in PHP won't really impact SEO, however, if the server script is running really slow due to no careful attention to optimizing the code (for example, memory leaking code and code containing loops that almost never finish), then all clients (including google) will see a slow loading website and that can have a bad impact on SEO.

If you decide in the future to add more processing to your script, then I'd suggest testing your webpages with webpagetest.org and in the waterfall chart, look for the light-green bar at the top (1st item requested). That indicates your TTFB. TTFB stands for "Time to First Byte" which means the time (in ms) it takes for the first byte to be downloaded to the client. The lower the number, the better. Google recommends making this number under roughly 200 ms, otherwise they will complain if you test your page using their pagespeed insights tool.

Here's an example of a PHP script that wouldn't affect SEO (assuming header.html and footer.html contain just basic HTML code.):

<?php
include "header.html";
?>
<p>Test html code</p>
<?php
include "footer.html";
?>

And this script will likely affect SEO:

<?php
sleep(50);
echo "Test page";
?>

This is because on execution, 50 seconds must elapse before any output is printed. From a user agent's perspective, this means it takes 50 seconds for "Test page" to appear on the screen which in today's world is 49.8 seconds longer than we'd like to wait for a word.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.