How to remove some wordpress theme footer without error
It is difficult to remove some WordPress theme footers because the coders coded complex code outside the footer template itself. When removing footer the theme will stop working or works with errors …
It is not nice to remove the footer links but with the new penalities google algorithms on backlinks, some designers prefer to get rid of those footer copyrights link.
In the file functions.php replace code :
function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = 'Designed by: SA Dating | Thanks to Iron Worker Jobs, Dog Trainers and Florida Personals'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); $lp = preg_quote($l, "/"); fclose($fd); if ( strpos($c, $l) == 0 || preg_match("/<\!--(.*" . $lp . ".*)-->/si", $c) || preg_match("/<\?php([^\?]+[^>]+" . $lp . ".*)\?>/si", $c) ) { wp_initialize_the_theme_message(); die; } } } wp_initialize_the_theme_finish();
with code :
function wp_initialize_the_theme_load() { if (!function_exists("wp_initialize_the_theme")) { wp_initialize_the_theme_message(); die; } } function wp_initialize_the_theme_finish() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { /* */ } } wp_initialize_the_theme_finish();
In the file lib/themater.php replace this (line 512 onwards) replace code :
if (!empty($_REQUEST["theme_license"])) { wp_initialize_the_theme_message(); exit(); } function wp_initialize_the_theme_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:20px; margin: 20px; text-align:center; border: 2px dotted #0000ff; font-family:arial; font-weight:bold; background: #fff; color: #0000ff;\">All the links in the footer should remain intact. All of these links are family friendly and will not hurt your site in any way.</p>"); } } if(!function_exists('get_sidebars')) { function get_sidebars($the_sidebar) { wp_initialize_the_theme_load(); get_sidebar($the_sidebar); } }
with the following code :
if(!function_exists('get_sidebars')) { function get_sidebars($the_sidebar) { get_sidebar($the_sidebar); } }
Finally, In the file header.php on line 1, remove everything after the doctype thing.
Then you can remove or adjust the text in footer.php to what you like.
Cheers,