Chances are, if you’re using WordPress, you will download a free WordPress theme, with which you will design your blog or site. One of the best things about WordPress is the sheer magnitude of themes available — offering you a seemingly infinite number of theme choices and combinations. One column, two columns, or three columns? Black background, white background, or something in between? You decide — and it’s this flexibility that helps WordPress stand head and shoulders above its competition.
Unfortunately, if you choose to use a free WordPress theme, you will likely encounter one in which the author encrypts code in the theme itself, linking away from your site to another page — from which he or she can generate revenue. Theme writers have to make a living too, so it’s somewhat understandable — but there’s no law that says you have to keep the links. And, in reality, these encrypted are undesirable for any number of reasons:
1. The links will only distract visitor’s attention from the content on your site.
2. They drive traffic away from your site.
3. From an Internet marketing stance, you always want more links coming into your site than going out of it, and you always want the links to and from your site to link to “strong” pages. This improves your page rank and gives you more credibility, resulting in more traffic. When hidden code creates links away from your site, it deprives you of valuable page rank “juice.” This becomes even more troubling when these links lead to advertising sites of questionable repute.
Your first inclination may be simply to delete the encrypted code from your footer — and that might even work. But most of the time it won’t, and erasing the code will cause your pages to act in strange and unpredictable ways. Fortunately, there’s a way to “unencrypt” these hidden lines of code, and it’s not nearly as hard as you might think.
What is going on here is pretty simple: these developers created the encrypted code in order to keep you from being able to read it. Unfortunately, when the code is executed to bring up your web page, it is unencrypted, and it’s only a matter of finding that unencrypted version of the code, and then replacing it in your theme’s footer. And that’s what I’m going to tell you how to do.
WordPress “calls” different components (like your header, your sidebar(s), and your footer) in your website using “php” commands. So, for instance, if you see your footer and your sidebars when you go to your index (or home) page, it means that those components have been “called,” and that’s why they appear. For this article, I’m going to use the index.php file as our target, because it is almost always the home page of any particular theme, and it almost always calls the footer.
1. Open your index.php in any web browser that allows you to view the source code (almost all — if not all — of them have this feature).
2. Next click “view source.” The screen will change and will show all the code for your index.php file. Scroll down the screen until you find the footer area of the source code. If you aren’t sure what part of the screen is the footer code, you’ll need to open up your footer in any text or html editor (like DreamWeaver, Text Mate, Coda, or the web-based WordPress theme editor in your administration control panel when you login to WordPress). What you can then do is create a commented sentence (it doesn’t matter what it says) just just before and just after the encrypted code (“commented” text is text that has “comment” tags before and after it. This makes the text visible in the middle of the code, but it isn’t executed by the code, so you can read it, but it doesn’t affect any of the commands written in a php or html file. Comments are useful for putting instructions in the middle of application code. To learn more about “commenting,” do a Google search for “comment tags for php.”). After that, you should be able to repeat the “view source” steps above, and you can just look for the commented sentence you added just before and just after the encrypted code.
3. Once you’ve located the footer section of your index.php file, you’ll notice that the part that is encrypted in your footer.php file is not encrypted when you view source. The reason is — as I said above — the code is revealed when it’s executed, and so it appears in the “view source” page of any web browser.
4. If it isn’t already open in a text or html editor, open your footer.php file. Simply copy the “footer” part of your “view source” results in your web browser, and paste them over the encrypted code in your footer.php file. This doesn’t change the file at all. The only difference is that the encrypted version of the code is replaced by the unencrypted version. They are exactly the same things, only one is totally illegible and unreadable to humans, whereas, the code from your “source” page is very easy to decipher.
5. Now all you have to do is identify the URL pointing at the troublesome external site, and delete it.
And that’s all there is to it!