How do I do onsite-optimization w/ a bunch of PHP code in it?

4 replies
  • SEO
  • |
I've had problems in the past going into client's websites and trying to find various folders that would house the index and internal pages. I don't know PHP that much and I would ask the owner of the site where I could find certain pages so that I could do some on-site optimization. The owner wouldn't know so I would proceed to ask him/her if I could get a hold of the website developer to ask the above questions. Sometimes I could get a hold of him - other times, I could not.

I guess my question is this: Is there a way to go in and know for sure that I can get to the pages that need optimized and not mess w/ the PHP code? Are pages stored in a "universal" folder (in which I doubt) or are they named to whatever the developer wanted them to be named? How is this done?

I am no means a PHP developer...I know HTML and CSS (along w/ JavaScript) but that is about it. Maybe I should outsource it to a developer?
#bunch #code #onsiteoptimization #php #w or
  • Profile picture of the author auradev
    You need a php developer to walk you thru what the code is doing so you dont break the site.
    {{ DiscussionBoard.errors[4229344].message }}
  • Profile picture of the author LeahRae
    Since I have zero idea of what the code and files look like I'm gonna give you a really generic answer.

    1st - No matter what you do! Make a backup, date it & call it original. 2nd - make another backup, this is the file you can use when things go wonky. Don't touch your original... that is your safety net.

    PHP can be tricky. If you are working on a Wordpress or Joomla site I highly recommend you do what Auradev suggested. Or at the very least please set up a mirror site to do your changes on. Then visit your local library & get a bunch of heavy books on PHP.

    In Wordpress & Joomla there are a ton of PHP pgs that for proper SEO require cleaner coding / compression / sutured calls. & then depending upon the template used... good luck! Sometimes you get lucky with a clean easy to follow format, other times your Alice down the rabbit hole. Your best bet is to create a PHP flow map to keep track of where certain functions were hidden.

    If you are working on a static website then working on PHP isn't as tricky. Still perform the 2 backups however. YOU NEVER want to be the reason the site went bye bye!

    On a static website there are generally 3 files. Where these files are are dependent upon the original designer. I again would recommend your creating your own flow chart documenting where these files are for your own sanity. Going back & forth can make you crazy if you aren't used to the format.

    1. The first file "a-content-page.php" calls the template file. The code looks like this:

    <?php
    $content_page = "a-content-page.html";
    $current = 2;
    include_once('a-content-page-template.php');
    ?>

    2. As you can see from the example above the code is looking for a file called "a-content-page.html" - This file is the meat & potato's of the page. It looks and acts just like a regular html file except it takes instruction from the PHP template.

    3. 'a-content-page-template.php' is the PHP template file that contains all the basic page instructions. This file is used to take care of all the static elements of a webpage just like CSS does.

    For instance: In CSS you can state that you want all your menus to be a certain color, size, font, etc.

    The PHP template does the same thing for menus, footers, headers, etc. Basically any common element on every page. Basically the PHP template saves you from doing the same task over & over on every page... a blessing if there are hundreds of pages to make an update to.


    Hopefully you now have a better idea of what you are looking at.
    Signature
    Get Found on the Internet with SEO based web design - http://www.elc-seo.com
    {{ DiscussionBoard.errors[4229715].message }}
  • Profile picture of the author ARVolund
    Usually on a php driven site there are no pages. Pages do not exist until the link is clicked so there is no folder of pages to look for.

    For instance on a site with a shopping cart, you click on the link to a product page. That product page does not exist like it does for a html site. The php file calls the information from the database and creates the page on the fly.

    While backing up and all that is great advice the best thing you can do is probably outsource what you need to do. Probably cheaper in the long run since somebody who knows what they are doing can knock it out quickly instead of you spending days trying to figure out what the hell you are doing.

    As always you have to keep the ROI on your time in mind. You have to ask yourself is it worth spending $25-$50 bucks to get the problems solved today or would it make more sense for you to spend a week that you could be making money doing something else figuring out how to solve this problem.


    Originally Posted by bigcat1967 View Post

    I've had problems in the past going into client's websites and trying to find various folders that would house the index and internal pages. I don't know PHP that much and I would ask the owner of the site where I could find certain pages so that I could do some on-site optimization. The owner wouldn't know so I would proceed to ask him/her if I could get a hold of the website developer to ask the above questions. Sometimes I could get a hold of him - other times, I could not.

    I guess my question is this: Is there a way to go in and know for sure that I can get to the pages that need optimized and not mess w/ the PHP code? Are pages stored in a "universal" folder (in which I doubt) or are they named to whatever the developer wanted them to be named? How is this done?

    I am no means a PHP developer...I know HTML and CSS (along w/ JavaScript) but that is about it. Maybe I should outsource it to a developer?
    {{ DiscussionBoard.errors[4231049].message }}
  • Profile picture of the author rahmanpaidar
    There is not much differences between optimization of an html and other languages.
    Php is a script inside html codes and has its own tags like other html tags.
    You can just igonore these language based tags except for html tags when
    optimizing.

    Just do optimization in a similar manner when you are optimizing for HTML.

    One important note is that crawlers know only html. So think like a crawler to
    optimize a page, no matter what the extension of the page is.
    {{ DiscussionBoard.errors[4231128].message }}

Trending Topics