WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a Wordpress Theme Designer. I want to have functions to make my footer links remain intact. Like some themes that use this method to protect their footer link from the theme downloaders to remove it.

If they alter, change, or deltete parts or all, they will get an error! Any step by step guide or source would really appreciated!

Thanks so much!



share|improve this question
up vote 2 down vote accepted

If you are releasing a GPL'd theme (which WP requires, but not looking to start the whole GPL debate here) then you can't prevent someone from removing your footer link. You can ask they they don't do it. But anyone who's looking to do so will get around whatever method you employ.

a side note: having these links in the footer may be more of a bad thing than good. I'd suggest reading this article on WPMU about how spammers using their themes caused them to get thrashed in their rankings.

share|improve this answer

The best way to do this (I don't approve of this method but I this is a different discussion) is to add your footerlink to wp_footer(), like that:

function your_link() {
    echo '<a href="#">Your Link</a>';
add_action('wp_footer', 'your_link');

You still don't have any prove that the Link exists and is not deleted. So set a transient in your function:

function your_link() {
    echo '<a href="#">Your Link</a>';
    if ( !get_transient( 'check_my_footer_link' ) {
        set_transient( 'check_my_footer_link', 'is_there', 600 ); //expires after 600 seconds
add_action('wp_footer', 'your_link');

Now you have a transient telling you, if the footerlink was called in the last 600 seconds.

The next step would be the message to the user, wherever you want to display the message, or if you want the site to die or whatever. I go with wp_mail() now, because you can use every kind of message to inform the user, from wp_mail to another footernote or anything else.

So, adding the messagefunction to your sites admin panel:

function messagefunction() {
    if ( get_transient( 'check_my_footer_link' ) != "is_there" ) {
        wp_mail( get_bloginfo( 'admin_email' ), 'You deleted the Footer Link', 'Bad Move' );

And call this function in the functions.php or any other file from your theme.

This method has a few drawbacks, as it could be that the site was not visited for 600 seconds, so the transient does not exist anymore. You could implement a counter for that (set an incrementing option 'views_of_site_without_footerlink', and just send the message if it is bigger than 1, and set it back to zero if the footer link is displayed).

Remember that it is not 100% safe, beacuse if a developer removes the notification stuff as well, it won't work anymore.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.