: SEO impact when using php include 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
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?
More posts by @Connie744
3 Comments
Sorted by latest first Latest Oldest Best
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.
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
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.