FREE* Remove Wordpress Theme footer links and Blogroll

wickedguy

Supreme Member
Joined
Jul 22, 2009
Messages
1,407
Reaction score
1,388
Hi guys

This is just a simple wordpress plugin I coded which will remove the footer links as well as the BLOGROLL from wordpress themes. You can modify it as you like.

To use it, save it as anyfilename.php and upload to the wordpress plugins directory and activate it in the admin panel.

PHP:
<?php
/*
Plugin Name: BlogRoll Remover
Plugin URI: http://blogbox.zar.tc
Description: Remove BlogRoll from WordPress Pages. 
Version: 1.0
Author: wickedguy
Author URI: http://blogbox.zar.tc
*/
 
function ws_set_up_buffer(){
    if ( is_feed() || is_admin() ){
        return;
    }
ob_start('ws_filter_page');
}
add_action('wp', 'ws_set_up_buffer', 10, 0);



function ws_filter_page($html){
$patterns=array('/<li><a href=\"http:\/\/codex\.wordpress\.org\/\">Documentation<\/a><\/li>/si',
'/<li><a href=\"http:\/\/wordpress\.org\/extend\/plugins\/\">Plugins<\/a><\/li>/si',
'/<li><a href=\"http:\/\/wordpress\.org\/extend\/ideas\/\">Suggest Ideas<\/a><\/li>/si',
'/<li><a href=\"http:\/\/wordpress\.org\/support\/\">Support Forum<\/a><\/li>/si',
'/<li><a href=\"http:\/\/wordpress\.org\/extend\/themes\/\">Themes<\/a><\/li>/si',
'/<li><a href=\"http:\/\/wordpress\.org\/news\/\">WordPress Blog<\/a><\/li>/si',
'/<li><a href=\"http:\/\/planet\.wordpress\.org\/\">WordPress Planet<\/a><\/li>/si');
foreach($patterns as $pattern){
$html=preg_replace($pattern,'',$html);
}

$pattern='/<div class=\"bottom\"(.*?)<\/body>/si';
if(preg_match($pattern,$html,$matches)){
$pat='/>(.*?)</si';
$match=preg_replace($pat,">  <",$matches[1]);
$patt='/<a href=[\"|\']?(.*?)[\"|\']>(.*?)<\/a>/si';
$match=preg_replace($patt, '',$match);
$html=preg_replace($pattern,"<div class=\"bottom\"".$match."</body>",$html);
return $html;
}

$pattern='/<div id=\"credits\"(.*?)<\/body>/si';
if(preg_match($pattern,$html,$matches)){
$pat='/>(.*?)</si';
$match=preg_replace($pat,">  <",$matches[1]);
$patt='/<a href=[\"|\']?(.*?)[\"|\']>(.*?)<\/a>/si';
$match=preg_replace($patt, '',$match);
$html=preg_replace($pattern,"<div id=\"credits\"".$match."</body>",$html);
return $html;
}


$pattern='/<div class=\"footer\"(.*?)<\/body>/si';
if(preg_match($pattern,$html,$matches)){
$pat='/>(.*?)</si';
$match=preg_replace($pat,">  <",$matches[1]);
$patt='/<a href=[\"|\']?(.*?)[\"|\']>(.*?)<\/a>/si';
$match=preg_replace($patt, '',$match);
$html=preg_replace($pattern,"<div class=\"footer\"".$match."</body>",$html);
return $html;
}

$pattern='/<div id=\"footer\"(.*?)<\/body>/si';
if(preg_match($pattern,$html,$matches)){
$pat='/>(.*?)</si';
$match=preg_replace($pat,">  <",$matches[1]);
$patt='/<a href=[\"|\']?(.*?)[\"|\']>(.*?)<\/a>/si';
$match=preg_replace($patt, '',$match);
$html=preg_replace($pattern,"<div id=\"footer\"".$match."</body>",$html);
return $html;
}

$pattern='/<div id=\"footer-wrap\"(.*?)<\/body>/si';
if(preg_match($pattern,$html,$matches)){
$pat='/>(.*?)</si';
$match=preg_replace($pat,">  <",$matches[1]);
$patt='/<a href=[\"|\']?(.*?)[\"|\']>(.*?)<\/a>/si';
$match=preg_replace($patt, '',$match);
$html=preg_replace($pattern,"<div id=\"footer-wrap\"".$match."</body>",$html);
return $html;
}

        return $html;
}

?>
:D
 
Um better be careful on what themes you use it on (*legal troubles...*). I've never ran into any of these problems myself, but you never know.

Great plugin, but couldn't a person just remove the footer text from a theme manually? It seems unnecessary to add an extra load to wordpress.

But great plugin, it may be useful to those who can't read code.
 
Um better be careful on what themes you use it on (*legal troubles...*). I've never ran into any of these problems myself, but you never know.

Great plugin, but couldn't a person just remove the footer text from a theme manually? It seems unnecessary to add an extra load to wordpress.

But great plugin, it may be useful to those who can't read code.

legal trouble for removing footer links?
 
Great plugin, but couldn't a person just remove the footer text from a theme manually? It seems unnecessary to add an extra load to wordpress.
Nope, some free premium themes keep footer links within the theme until you purchase it. Trying to remove the footer links would make the theme "collapse".
 
Nope, some free premium themes keep footer links within the theme until you purchase it. Trying to remove the footer links would make the theme "collapse".

Not with this plugin. The footer can even be encrypted. It will still try to remove the links :D
 
is there anyway to add a whitelist? so that it would remove all the rubbish link that came with the template, but still displayed links i wanted to.
 
I am a newbie so this might be a stupid question. But I am getting the following error..
Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature
 
is there anyway to add a whitelist? so that it would remove all the rubbish link that came with the template, but still displayed links i wanted to.

Well, buddy you can modify the script if you want it to filter some of the links. :D
 
I am a newbie so this might be a stupid question. But I am getting the following error..
Incompatible Archive. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

I think the folder which you are uploading is Rar file. Convert it to zip the upload to wordpress plugins.
 
I used it and it worked great thanks. However my pages still have

"Blog Roll

<hr>

parent page: 'whatever page name i am on' "

It did remove the 7 links that were there. Anyway to remove this remaining annoyance? thanks
 
ha ha last night i looking this..now i got it..thanx man im gonna test it
 
"You must spread some Reputation around before giving it to wickedguy again."

You are the man!
 
I thought that removing the wordpress footer was agaisnt there terms?
 
Back
Top