How To Use The Custom PHP Function in SEO Booster Pro v1.5

The recent release of SEO Booster PRO 1.5 created a few questions from users how to implement on their blog, so I decided to create a more detailed walk through on how to add the new function to your WordPress Theme.

If you are not “at home” or feeling comfortable editing PHP or HTML manually, you should skim this instruction first, and then decide if you want to do it yourself or ask someone to help you….

First of all, make sure you have fully uploaded and activated SEO Booster PRO v1.5

Now, lets say you want to add a list of the most popular incoming searches beneath your blog post, such as this one here:

Top 10 incoming search phrases in a list!

Step 1. Log in to your WordPress site, and go to “Appearance”->”Editor”.

Make sure you can edit your theme, so if you see this message underneath the window, you need to make the file(s) writeable. Follow the link in the message for more information on how to do that.

You need to make this file writable...

You need to make this file writable...

Step 2. Locate the Single Post file (USUALLY named ’single.php’) and click it to edit it.

Single Post (single.php)

Single Post (single.php)

Step 3. Copy-paste the ENTIRE contents of single.php to somewhere on your computer, so if something goes wrong, you can always go back to that.

Step 4. Scroll inside the window to find “the_content();”
This might look different from theme to theme, but do not worry, we are not gonna edit that part, we are just gonna add something after it.

Personally, I wanted to add a little headline explaining the list, so I put this in just before:

<p>Popular Incoming Search Queries</p>

but it means nothing for the functionality of the php-function.

Insert the following code:

<?php
if(function_exists('seoboosterpro_boostlist')){
   seoboosterpro_boostlist('<ul>','</ul>','<li><strong>','</strong></li>',10); }
?>

Just after the “the_content();” line.

Here are the before and after screenshots:
Before:

Picture 16

After:

Picture 17

Now, that is it. (Remember to press save before you can see the changes).

If something should go wrong, after you press refresh and some weird errors appear, remember you are editing a WordPress Theme, which is a mix between PHP and HTML code, and that combination is never very forgiving, so if you do not know what you are doing, you are lucky you saved a copy of the working code in step 3 (you did remember that, right?)

Get in contact with someone who knows how to edit PHP and HTML, and ask them to help you out (refer to this page for the instructions).

Please remember, if nothing is displayed it might be because there has been no search engine traffic to that page yet.

The parameters

The parameters outlines like this:

function seoboosterpro_boostlist($before, $after, $beforeeach, $aftereach, $limit)
  • $before : What to output before the list appears
  • $after : What to output after the list appears
  • $beforeeach : What to output before each item in the list
  • $afterearch : What to output before each item in the list
  • $limit: Maximum number of results to display
  1. alfon says:

    wow this very helpful when i read this article i’m realize that i made many wordpress mistake.. i never use that syntax or modifying my wordpress template editor, i hope after i try this tutorial my wordpress blog getting better. thank for the tips now i’m bookmarking your blog for my next visit thanks a lot my friend

  2. hifa says:

    inserting popular searches..will not this be keyword stuffing? which search engines do not like..

    • admin says:

      Hi hifa

      By overdoing it, yes, it can be bad for your rankings, but not when you do it with care and moderation.

      Keyword stuffing is generally referred to when you put in hundreds of keywords in different areas of the text/code, which rarely have no relevance to the actual content, and are put in hidden div’s or in the meta tag.

      Remember, SEO Booster PRO only shows the keywords that visitors have already used to find your post, so in fact it only increases the post’s value relevant to those keywords that are dynamically displayed.

      Thank you for dropping by, please if you have any more questions, feel free to ask away :-)

      • hifa says:

        thanks for clarfying me. well, maybe it will not be keyword stuffing but in most the of SEO tips articles i read keywords in your content should not be over %3-5. I guess displaying 3 most popular search queries will not be problem. what is ur suggestion ? may i feel free to display 5 also :)
        Thanks

        • admin says:

          Go nuts! :-)

          In fact, depending on the length of your articles, you could show even more. I’ve had success with showing as many as 15 on some of my test sites. (No slap so far).

  3. Hey Lars,

    So heres a interesting feature to put that forward. Lets say you have 15-20 different longtailed queries from the plugins research. Can we put the limit to lets say 3-4 and then have the plugin randomly list 3 or 4 out of the array and output that to the hidden div. The fact that its dynamic would help bolster the fact that your not keyword stuffing.

    Larry

    • myWordPress says:

      Hi Larry

      That is actually a nice suggestion. It should be fairly easy to implement as an option. You can already limit the amount of links it shows in the widget itself. I believe the default setting is 10. I’ve marked down your suggestion for a upcoming release (no promises when :-)

  4. hifa says:

    Hey Lars,
    this feature works like magic, thanks!
    but i sometimes see irrelevant search queries too. the search terms we enter in the setting Query Ignore List also applies to this custom php ?
    though i add to exclude some words, they still displayed in posts.
    maybe cache coz of cache plugin but wanted to make sure.
    Thanks!

    • hifa says:

      Lars,
      as i stated in my previous comment, could you please enable us to prevent the quieries we want that displayed when this code inserted?
      It would be nice!

      • myWordPress says:

        Hi Hifa

        Sorry for taking so long to respond. I am polishing the final tweaks to a new release of SEO Booster PRO, expect it to be released later on today.

        The new version will have the requested feature implemented and ALSO a really cool new feature which I think you will enjoy :-)

      • myWordPress says:

        Hi hifa

        As promised, the new version has just been released (check your e-mail), and you can read about the other really nice features here:

        http://mywordpress.com/seo-booster-pro-1-7-released/

  5. Fernando says:

    I use you Pro version, but how I do this “Popular Incoming Search Queries” but with the links activated?
    Because when I do this, it’s just text without links.

    Please help.

    • myWordPress says:

      Hi Fernando

      The function is supposed to be without link, because the text shown is for the individual blogpost.

      http://yourblog.com/postA
      The function here shows the incoming searches for blogpost A

      http://yourblog.com/postB
      The function here shows the incoming searches for blogpost B

      The widget shows the same links ALL over the blog. This is to add extra value to the individual blog posts.

      I hope this explanation helps your question?

PRIVACY POLICY: Your privacy is important to us. We will never sell or rent your email address and you can unsubscribe at any time.

If you check the check-box above and leave a comment, you will sign up to our newsletter, but do not worry, we only send out very few e-mails. We usually only send you an e-mail when we launch a new product, want to touch base with our e-mail readers or we have found a really really cool product we want to tell you about.

line
footer
Powered by Wordpress | Designed by Elegant Themes