Blog > Content Marketing > How Do I Remove My WordPress Theme Footer Links?

How Do I Remove My WordPress Theme Footer Links?

Published by James ParsonsContent Marketing • Posted November 30, 2015
Written by ContentPowered.com

WordPress footers have some good information in them, but at the same time, they’re kind of obnoxious. They also herald the fact that you’re using WordPress, which isn’t always a good thing. WordPress is a very, very widely used platform, and that means it’s often prone to hacking and exploit attempts. When a new exploit comes out, hackers will try it on sites they know run WordPress. If your site proudly displays a footer, that’s a sign saying “attack here.”

Of course, that’s not the only reason to want to remove them. The most common issue is not wanting to display the (generally spammy) backlinks that appear in the footer, or sometimes the footer itself doesn’t fit with your intended site design.

Unfortunately, there’s generally no easy way to remove the footer. It’s not as simple as just finding a “display footer” checkbox and unchecking it. You’re going to have to do a little digging. Here are some methods I’ve found to remove the junk links from your footer file, depending on how well the developers hid the data.

Editing PHP Files

Several of the methods below will involve editing PHP files directly in your site installation. This will typically involve accessing your web host to find the file, downloading the file to your computer, making the edits you want to make, uploading the file to test, and repeating the process if the test you made broke something or didn’t work.

PHP files are simply text files that contain code written in PHP, which is a very common coding language used in conjunction with HTML for web development. PHP itself is a recursive acronym, meaning it includes itself in the definition. Specifically, it stands for the PHP Hypertext Preprocessor.

Methods used to access your web hosting will vary from host to host. Typically you will be able to access it via FTP or directly through your web host dashboard. If you need help, a web developer or the support staff on your web host will be able to assist you.

Editing PHP is fairly basic and easy. You don’t need any special tools to open the documents, nor do you need any special tool to close or compile them, as they do not need to be compiled. That said, it’s easier if you use a piece of software that can interpret PHP and notify you if you caused a syntax error before you upload a saved file to test.

Footer PHP Encrypted Example

For Windows machines, you can open documents in Notepad or Wordpad and edit them just fine. However, you should avoid opening them in something like Microsoft Word, which will add meta data to your documents which will break them. If you want to use a third party app that will streamline code and highlight syntax, you can use Notepad++, found here. For Apple machines, you can use BBEdit or TextMate. You can also use HTML Kit on either platform.

Always save an unedited copy of your target file before you attempt to make edits. You don’t want to upload a broken version and have no way to revert your changes if they didn’t work. If you’re going to do a lot more editing, you can install a local virtual PHP environment in which to test changes to your site. This is what most developers use, so they don’t have to wait, authenticate, and make changes to a live Internet server.

Typically, most of the changes you’ll need to make with PHP files to remove footer information will be minimal and can be done with Notepad or HTML Kit. If none of the simple methods work, however, you may need something more advanced, like Dreamweaver.

One thing to note when using any text editor to edit PHP files is to make sure the encoding is still set to ANSI. This will typically be found in a settings menu of the editor. If the file is accidentally saved as UTF-8, Unicode, or some other encoding format, you may have special characters added to your document. The usual offender is the Byte Order Mark, or BOM, that looks like . Unfortunately, you can’t see this marker if it’s added to the file, unless you change encoding back to ANSI. If you upload a file to test and your entire site no longer functions – the white screen issue – this can be the offending mistake.

Make sure you back up your theme before you do too much modifying, just in-case you mess something up.

The Basic Dashboard Method

Edit Footer PHP

This is the simplest method, so chances are it’s not going to work. It will work for some themes, but most of the time the theme author wants their credit to stay on the theme, so they’ll go out of their way to make it harder to remove. That, or they’ll use a template for their theme design that has code to make it harder to remove. Both are pretty common.

To do this, go to your WordPress dashboard and click on the theme editor. You will be presented with a list of files. Among them, you will see footer.php. When you find it, open it up and you’ll be able to remove whatever code is offending you. Theme credits, hosted by WordPress lines, and all the rest will be in this file. Ideally, you will be able to edit the file or remove it entirely and your site will still work.

Make sure you back up the file before you edit it or remove it, just in case. If you don’t, you run the risk of breaking your site until you fix it, which could otherwise require a more complete installation of the theme all over again.

Check Your Footer.php File

This is essentially the same method as the previous one, except for some reason the file doesn’t appear or isn’t accessible to the WordPress dashboard. If you can’t access, open, or save the file, download it locally to make the changes. This might involve removing entire lines, or it might just mean editing some text.

I can’t tell you where in the file the code will appear. You will have to find – ctrl-F – the phrases that appear in the footer document and find the specific bit of code that includes them. If you want to remove the footer entirely, however, you will have to look for the code in other files that pulls it.

Check Functions.php for Footer References

This is where you will find code that references the footer. Now, some themes will require a footer to exist, but that footer can have no data just fine. I can tell you that in some themes, the code will appear around line 120, and in others it will be deeper, around 660. This will vary depending on the theme, of course. Again, you will want to search for specific text that appears in the footer to see if it exists.

Footer Hook in Functions

Another possible entry you can search for is the code that calls the footer. This, in PHP, will look something like “function footer_output($footer_content)”. If you do a search for footer_output or footer_content you will find these entries, which will allow you to edit or remove the code as necessary.

Note that sometimes there will be comment warnings in both the footer.php and functions.php files telling you that modifications that remove footer information will have dangerous consequences. Usually these consequences range from data corruption to nonfunctional sites to legal action. You don’t have to worry about these, though it’s never a bad idea to keep a backup. The worst thing that can happen from removing information like that is your site going white when the PHP errors looking for data it can’t find. If this happens, you won’t be able to remove the code, but you may be able to remove what it calls.

For example, sometimes there will be code that calls $footer_content and then specifies that $footer_content .=’Powered by WordPress & Coded by Theme Author X’;. If this is the case, removing that entire line will break the code because it still calls the footer content, but there’s no reference to what the footer content is. Instead, you will have to remove the text between the ‘ marks, so it just says $footer_content .=’’;. This way, when the site calls the footer content, it will respond with what it expects, it just won’t have any data to display.

Check Related Files

Sometimes your main footer.php or functions.php files will call data from other files rather than simply call the footer natively. They might even include the footer call code just as a red herring, so when you try to remove it, the footer will still exist. In these cases, the footer is probably being called from other code. I’ve seen it in other places in the functions.php code, under an init hook, where it calls data from other sources or specified variables. Again, searching for the word “footer” will usually identify the function and allow you to trace it. You can also search for the add_action function, though you will probably get more unrelated results from it. You can read about this in action for the Attitude theme here.

Note that if you follow the instructions on the Attitude theme page, what you will be doing is making a child theme. This is when you take an existing theme and edit it to suit your own needs. It’s not meant for distribution; rather, just personal use. A child theme will require the presence of the original theme, because it reuses the majority of the files. All it does is change a few code references to the new theme, the child version.

If you do choose to use the child theme method, you will need to go into your WordPress installation afterwards and activate the child version. Otherwise, your theme will be stuck in the previous version and your changes won’t actually take effect.

If you want a deeper understanding of how functions work, and how child themes work, you can read this excellent post.

Premium Upgrades

At this point, you have two options. See, we’ve exhausted all of the easy ways to remove a footer. If you’re challenged by the code – and I know some people are – the methods you’ll have to use in the next section will be head-scratchingly daunting. However, many themes are developed by people as free versions for more robust, less limited versions that cost money. These premium versions of the theme almost always have the copyright section removed from the footer, or the entire footer removed, so it’s much easier to customize the way you want it.

Premium WP Theme Upgrade

You might consider buying the premium theme, is all I’m saying. They’re generally reasonably priced, one-time purchases, so you don’t need to worry about investing too much. Plus, remember how I mentioned the vague possible case of legal action? It’s pretty much never going to happen, but you should probably cover your bases if you’re using a hacked together theme to base your entire web presence.

Use Dreamweaver and Search for Footer Data

This method requires you to have Adobe Dreamweaver, or some other similar robust web development program. Dreamweaver used to be some obnoxious $600 program like all the Adobe development tools, but they discovered more people were pirating it than buying it legit, so they made a monthly fee to access the entire development suite. Today, you can get access to Photoshop, InDesign, Dreamweaver, Illustrator, and more all for a $40 monthly fee. Dreamweaver alone is just $16 monthly.

This is an overkill method used for when a theme hides the footer calls under a different name, and hides references in files other than the footer.php and functions.php files. What you will want to do is open each file in turn and search for the plaintext anchor for the links in your footer. For example, a “coded by X” phrase can’t be hidden very easily, so even if the footer code isn’t called footer, you can still find “coded by” in the file somewhere.

When you find the phrase you’re looking for, you will have to experiment with removing it or editing it. Most of the time, just removing the text but keeping the function will work without breaking anything. Sometimes the theme will check for a certain presence of text, so you may have to just edit the footer instead of removing it completely.

Check for Obfuscated Code

Sometimes, you’ll run into obfuscated code. Obfuscation is the act of hiding what the actual code says, to make it impossible to edit or find in search. For example, you might see something that looks like this:

  • eval(base64_decode(‘Yhpb2cl9tZd34g3R3RXR lBfZ2ZnVuV0X2ZvbKCl=’));

That’s obviously not valid code. It’s encrypted code, hidden in base 64. If your footer code is hidden behind this, it will still run. The eval command is a PHP command that tells the app – in this case WordPress – to decrypt the code. Base 64 tells WordPress how to decrypt it.

The end result is that if you try to ctrl-F “footer” or the text that would be in the footer, you won’t find anything. The actual text strings aren’t part of it.

Functions Spam Links

There are two steps you can take here. The first is the more complicated. You can decrypt the code manually using a site like this one. Once decoded, you can view the code in plain text and edit the footer information just like you would in one of the first steps. Then you can add the unencoded code to the file and see if it works. It should, but sometimes some code will verify that the code was encrypted, so you will have to re-encode the code and put in the eval line again. If even that doesn’t work, well, you’re probably out of luck unless you want to go digging for verification, at which point you have to wonder just how much this is worth to you.

The other option, and the more sensible one in my book, is to just get a different theme. Obfuscation is a dangerous game with WordPress themes, and it indicates that the theme owner has something to hide. It’s not more efficient, all it does is prevent casual editing like what we’re doing in this post.

Frankly, if you find a theme with obfuscated code, you never know what it’s doing. You will have to trace every action and every piece of code in the theme to see what it’s doing, and sometimes it’s really not clear what actions it’s making. I’ve seen obfuscated code – like this code – that names all of the variables and functions random names like $R5C7D265CC. That tells you nothing, and it will take a lot of effort to figure out what’s going on with the theme. In the mean time, it could be logging your admin actions, stealing your authentication information, or leaving a backdoor open for a hacker. You have no way of knowing.

If, after all of this, you still can’t edit the footer, I’d recommend just tracking down the creator and asking. Some of them will help, others will ignore you, and some will point at their premium theme. It’s up to you what you do from there.



Comments

Questions for us? Comments? Thoughts? Leave a reply!

Leave a reply

Share33
Tweet
Pin
Buffer
33 Shares