WordPress Streamlining Cut the Code

Bread and Salad Can Kill a Google Bot

Or you could say:

Where’s The MEAT

Cut The Code Feed The Bots

Cut The Code Feed The Bots

I look at page source code all the time.   I want to know how many lines of code a search engine bot has to navigate before it gets to the meat.

How often do you check your page source for you site?   Never?   That’s not a good thing.

You should check your page source every time you make a change to your blog structure.

  • Add a new plugin check your page source
  • Change Themes check your page source
  • Add a new widget check your page source

All of these things can add a lot of lines of code to your site keeping the search engine bots at bay and preventing them from reaching the meal you have prepared for them to find, digest and index.

The Story of an added Salad to the Dinner

Sometime ago I added the wp-table plugin to test and see if I could quickly design and post a table inside WordPress.   I have always used Dreamweaver for table design and then use the HTML editor in WP (Since the Visual Editor Screws up Tables) to put them inside of posts.

I tried it once, it was limited, But I didn’t deactivate the plugin   I just didn’t use it anymore.

At the moment I’m checking sites to see how many lines of code a bot has to navigate before it gets to the meat (content to index).   I found that wp-table plugin added 26 lines of CSS code to each blog post.   My content didn’t start until line 100 on the page.   Once I deactivated the wp-table plugin the content started on line 74.   That is 25% closer to the top.   Twenty five percent of a meal removed from the table the bots don’t have to gobble through to get to the meat.

If I had liked using this plugin I would have found a way to add the CSS styles to my styles sheet and remove it from the plugin code.   Your style sheet is where your CSS belongs and not on the page itself.   That way it is a one line call to that file for formatting.

I just checked a site (Outside Blogs) which put all the styling on the page itself and not in a file (poor coding).   There are 850 lines of code before the bots get to the content.   Holy Cow that’s a lot of bread and salad to have to eat before you get to the meat.   It is like having a store and everything you have for sale is in the sub basement 850 stories below ground.   Do you think your customers want to go down 850 stories just to see what you have for sale?

Feed the Bots quick, Keep them Happy : )

 

Comments

  1. A couple (stupid) questions:

    1. What do you consider to be “the meaty part”? meta tags? on page customer viewable information?

    2. What do you consider to be a good number? 74? 100? or is it just dependent on the site as to whatever you can get out of it?

  2. Malok,

    The content of the post is the meaty part. The meta tags are almost always at the top of the page.

    I think 100 is a good goal, even less if possible. I set 100 in the post as an arbitrary figure.

    However, a site that takes 800 to 1000 lines of code to get to the content of the post is heavy on Bread and Salad.

    For static sites, the site authors should put the content as close to the top as possible and all the rest of the format (sidebars, navigation, header code, footer code, etc.) after the content. This way the search bots hit the “meat” early on each page and post.

  3. Alrighty – thanks for clarifying.

    Another stupid question:
    You say to right click and View Page Source. Is there a way to count how many lines you have without having to do it manually?
    [I would assume you didn’t count by hand the 850 lines of code?]

  4. Well, I’m back home on Kauai, so maybe I’ll have more time to participate in the blog.

    The closer you can get your content (meat) to the top of the page, the better. Obviously there is some code that needs to be placed on the page, but many things can be moved below the “meat” (in the code) and still appear above the “meat” visually in your browser using CSS and no tables.

  5. Malok,

    If you are using Firefox browser you right click select view page source then scroll down to where you see the first line of content or title tag for the post. Click next to that line and in the lower left hand corner of the window you will see the line count.

    Here is one to try it on. http://is.gd/10SD

    I think the title line is on line 859.

    You are very right, I didn’t count them LOL.

  6. Excellent. Never knew that. Tyvm. 🙂

    (I was trying to count manually.)

  7. Great post Dave! The easier it is for the bots to read your content the easier its gonna be for your blog or website to get rankings. Keep all your code clean it makes life easier for you and the search engines.

    Using the FireBug plugin for FireFox helps out a lot. You can inspect all the code section by section and find out exactly where your content starts.

  8. James Boyer says

    Also great post. I believe that my blog which is linked to from my name is fairly lean on the code bloat but you tell me?

    Jim

  9. Looks like my main site sits at 81 lines. Not to bad, but think I could do better. There are 30+ lines of CSS I am not sure about, should all be in the CSS file. Will have to look further into that.

  10. With having too much bloated code is the problem that the bots will at some point quit going through code and not get to the meat or is the problem that having too much code compared to content hurts SE’s from properly weighting what a page is about.

  11. Looked at my source code using the method Dave recommended. Here is an interesting question – should comment lines and blank lines be included or should the total of the aforementioned lines be substracted from the line with the meat and potatoes?

  12. Glenn,

    I count them in my total, they are in the browser and still have to be passed before they bot gets to the content.

  13. Dave – thanks for the response need to carve some of fat off the meat. 🙂

  14. Dave,

    Great post. I never even considered any of this, but will be sure to check from time to time. I checked a few of my pages and the “meat” starts about page 80 on average, so I guess I am ok for now.

    I am really just getting deep enough into blogging to understand any of this conversation, but your post are simple enough for me to digest, understand, and implement.

    I use Fire Fox, so the tip on checking the line number of the code was big. Thanks!