一、如何去掉或者取消WORDPRESS主题中HEADER和FOOTER中的版权
很多人在下载了自己中意的Wordpress主题,但页脚的链接去不能去除,今天在帮朋友装一个Wordpress博客的时候就遇到这事,在百度了好久没收到什么结果,没想到最后以一个不可思议的办法来解决这个事情,但我们并不建议去掉人家的版权链接,这里只做参考学习。
一般为统计博客版本信息等原因,wordpress会在头部置入一下版权信息 部分人为了安全,希望能去掉这个信息,因为不知道版本也就无法针对具体版本的漏洞进行攻击,当然还有其他原因…… 直接看看去掉的方法:在你的当前主题funtions.php中添加以下代码,并建议放在最前面 function i_want_no_generators(){return '';}add_filter('the_generator','i_want_no_generators'); 一般来说,为了博客的安全,还是建议大家把wordpress中的版本信息去掉,象wordpress2..92,wordpress 3.0.1这个注释掉,防止黑客或病毒攻击,上面应该是最好的方法了吧,最简单,也是最暴力的方法就是直接把 How To Remove Encrypted Footer From Wordpress Theme?Please follow these steps to remove footer encryption from wordpress theme footer:Step 1Open index.php and find include code for the footer. The footer include code looks like:<?php get_footer(); ?>Step 2Add this comment code on the top and bottom of the footer code:<!–footer code="" starts="" here–=""><?php get_footer();="" ?=""><!–footer code="" ends="" here–="">Save the file and upload it to the server.Step 3Load the theme in a browser. View the source code by clickingView -> Source (If you view in IE) orCtrl + U (If you view in Firefox)Step 4The source code in between <!–footer code="" starts="" here–=""> and <!–footer code="" ends="" here–=""> is the source code for the footer.Now, open footer.php and replace the encrypted code with the actual source code. We can then start to modify the footer in anyway we want. But make sure that we have taken require permissions from the theme author. 如果英文看不懂的话,可以GOOGLE翻译下,也可以留言问我。 网上关于去除版权版本等信息的资料 wordpress版权去除 如果只修改以下footer.php,,当点「更新文件」时就出现了这样一句话:This theme is released under creative commons licence, all links in the footer should remain intact而且后台也进不了了,始终出现的都是这句话。
没办法,只有通过FTP重新上传了主题,还好现在可以进了,不过footer.php那依然不能修改,改了就又会出现那句话。查找了有关资料发现header.php有两段关於eval的语句,functions.php里也有。
问题就在这里,下面介绍解决方法吧:一:先删除header.php里开头的那个eval语句,即:<?phpeval(str_rot13('shapgvba>?phpeval(str_rot13('shapgvba>
vagnpg');qvr;}}purpx_s_sbbgre();'));?>二:将header.php里第二处eval语句<?php eval(str_rot13('shapgvba="">?php>
vagnpg');qvr;}}purpx_shapgvbaf();')); wp_head(); ?>用<?php get_header();="" ?="">替换掉。三:去掉functions.php开头的<?phpeval(str_rot13('shapgvba>?phpeval(str_rot13('shapgvba>
。vagnpg');qvr;}}'));?>四:删除functions.php里面的check_header();有多少处,删多少!五:没有了,至此你已经对footer.php有绝对控制权了。
可能是由於习惯,经常习惯了把版权信息去掉,我在使用wordpress过程中,发现功能版块除了登入\登出,管理,Feed以外,还有一个wordpress链接。太讨厌了,博客底部本来就有一个wordpress.org的链接,结果现在又有一个链接,光一个页面就有2个链接,下面,我还是教大家如何去掉它好了。
找到你的博客安装目录,在wp_includes文件夹下面有一个default-widgets.php的文件,并找到以下代码」 href=」http://wordpress.org/」>WordPress.org我们把这一行所在的代码全部删除了。注释掉或者直接删掉。
这样侧栏上的wordpress.org链接我们就去掉了。 在wordpress中,一般情况下,在header的信息总是会包含wordpress的版本信息,如何去除这个内容呢,很简单,在function.php中添加remove_action(『wp_head』, 『wp_generator』);就可以去除wordpress的版权信息了。
在wp博客中,有一个常见的安全技巧是:不要在你的wp中显示出你的版本信息。许多开发者或者使用者都常常将wp的版本信息显示了出来,但这样可能会被一些人利用该版本的漏洞对你的博客进行攻击。
很多人对此比较模糊,这样可能就会给你的博客带来安全性的问题。默认情况下,当wp_head() 函数在header.php文件的head标签中被调用时wordpress就执行了wp_generator(),wp_head()函数所处位置如图: 当wordpress在网页中运行时,wp_generator()函数输出如下内容(可以在页面源代码中查看到):1转载请注明出处51数据库 » wordpress注销
?php>!–footer>!–footer>!–footer>?php>!–footer>
恺撒(教主)