1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

FREE* Remove Wordpress Theme footer links and Blogroll

Discussion in 'Blogging' started by wickedguy, Jan 19, 2011.

  1. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    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'100);



    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
     
    • Thanks Thanks x 42
  2. DavidG2

    DavidG2 Newbie

    Joined:
    Jan 17, 2011
    Messages:
    37
    Likes Received:
    3
    Occupation:
    Are you kidding me?
    Location:
    Orlando
    Home Page:
    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.
     
  3. BlackxHat

    BlackxHat Power Member

    Joined:
    Oct 6, 2009
    Messages:
    591
    Likes Received:
    78
    legal trouble for removing footer links?
     
  4. Robert(seous)

    Robert(seous) Newbie

    Joined:
    Dec 16, 2010
    Messages:
    48
    Likes Received:
    15
    Occupation:
    SEO Specialist and Video Designer
    Location:
    South Florida
    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".
     
    • Thanks Thanks x 1
  5. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    Not with this plugin. The footer can even be encrypted. It will still try to remove the links :D
     
  6. Robert(seous)

    Robert(seous) Newbie

    Joined:
    Dec 16, 2010
    Messages:
    48
    Likes Received:
    15
    Occupation:
    SEO Specialist and Video Designer
    Location:
    South Florida
    Works like a dream bro! Thanks! What's your PayPal? I'd like to donate :D
     
  7. radenyoga

    radenyoga Newbie

    Joined:
    Nov 11, 2010
    Messages:
    42
    Likes Received:
    6
    i will try son...
     
  8. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    Glad to hear it is of use to someone :D
     
  9. SnowySage

    SnowySage Newbie

    Joined:
    Mar 1, 2008
    Messages:
    16
    Likes Received:
    2
    Nice! Been wanting to find a plugin like this for quite some time now :)
     
  10. G-S-T

    G-S-T Executive VIP Jr. VIP

    Joined:
    Jan 20, 2011
    Messages:
    1,836
    Likes Received:
    8,801
    Occupation:
    Full time IM
    Location:
    Heavy in the game
    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.
     
  11. jatin11

    jatin11 Newbie

    Joined:
    Nov 16, 2010
    Messages:
    7
    Likes Received:
    0
    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
     
  12. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    Well, buddy you can modify the script if you want it to filter some of the links. :D
     
  13. 7 Zulu

    7 Zulu Newbie

    Joined:
    Jan 14, 2011
    Messages:
    26
    Likes Received:
    6
    Home Page:
    Awesome plugin, Thanks!
     
  14. wickedguy

    wickedguy Supreme Member

    Joined:
    Jul 22, 2009
    Messages:
    1,402
    Likes Received:
    1,379
    Location:
    BHW--> South Africa
    Home Page:
    Thanks bud, ENJOY and don't get into trouble :)
     
  15. Knoxgates

    Knoxgates Supreme Member

    Joined:
    Aug 9, 2008
    Messages:
    1,266
    Likes Received:
    918
    I think the folder which you are uploading is Rar file. Convert it to zip the upload to wordpress plugins.
     
    • Thanks Thanks x 1
  16. yagervideo

    yagervideo Newbie

    Joined:
    Jan 11, 2012
    Messages:
    1
    Likes Received:
    0
    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
     
  17. findecko

    findecko Junior Member

    Joined:
    Dec 26, 2011
    Messages:
    148
    Likes Received:
    92
    Works perfect man, rep given <3
     
  18. fmOzilla

    fmOzilla Power Member

    Joined:
    Nov 11, 2011
    Messages:
    714
    Likes Received:
    384
    Location:
    C:\Windows\System32
    ha ha last night i looking this..now i got it..thanx man im gonna test it
     
  19. spasovski

    spasovski Regular Member

    Joined:
    Mar 21, 2011
    Messages:
    394
    Likes Received:
    240
    Occupation:
    Web designer and Internet marketeer.
    "You must spread some Reputation around before giving it to wickedguy again."

    You are the man!
     
  20. klcouponscom

    klcouponscom Registered Member

    Joined:
    Dec 27, 2011
    Messages:
    90
    Likes Received:
    20
    I thought that removing the wordpress footer was agaisnt there terms?