随着互联网的普及,越来越多的人选择使用WordPress搭建自己的网站。WordPress以其强大的功能、丰富的插件和简洁的操作界面赢得了用户的喜爱。在使用WordPress的过程中,你是否遇到过版权问题?你是否希望去掉WordPress官方的版权信息?本文将为你详细介绍如何去掉WordPress版权,让你的网站更加个性化。
一、什么是WordPress版权
WordPress是一款开源的博客发布平台,它拥有庞大的用户群体。WordPress官方保留了版权信息,以便于保护其知识产权。当你使用WordPress搭建网站时,默认情况下会显示版权信息。这些版权信息通常位于网站底部或页脚位置。
二、去掉WordPress版权的原因
1. 个性化需求:去掉版权信息可以使网站更加个性化,摆脱官方束缚。
2. 美观度提升:去除版权信息可以使页面布局更加简洁美观。
3. 避免侵权风险:在一些特定情况下,显示版权信息可能会引发侵权风险。
三、去掉WordPress版权的方法
以下是一些常用的去掉WordPress版权的方法:
| 方法 | 操作步骤 | 优点 | 缺点 |
|---|---|---|---|
| 1.修改主题文件 | 1.打开WordPress主题文件夹中的footer.php文件。2.查找并删除或注释掉显示版权信息的代码。 | 简单易行,适用性广 | 可能需要修改代码,有一定技术门槛 |
| 2.使用插件 | 1.在WordPress后台插件市场中搜索“RemoveFooterCredit”等关键词。2.安装并激活相关插件。3.根据插件设置,去掉版权信息。 | 简单易行,无需修改代码 | 可能存在兼容性问题,需要定期更新插件 |
| 3.修改主题设置 | 1.进入WordPress后台,找到主题设置页面。2.在相关设置中找到版权信息选项。3.取消勾选显示版权信息。 | 无需修改代码,操作简单 | 适用性有限,仅限于支持主题设置的主题 |
| 4.自定义代码 | 1.在WordPress后台,进入外观>主题编辑。2.选择footer.php文件进行编辑。3.删除或注释掉显示版权信息的代码。 | 自定义性强,适用性广 | 需要一定的技术基础,可能影响网站其他功能 |
四、注意事项
1. 备份:在修改主题文件或插件设置之前,请确保备份你的网站,以免出现意外情况。
2. 兼容性:在使用插件时,请选择知名、评价良好的插件,避免兼容性问题。
3. 版权问题:虽然去掉版权信息可以提升个性化,但请务必尊重原作者的知识产权。
五、总结
去掉WordPress版权可以让你的网站更加个性化,摆脱官方束缚。本文介绍了多种去掉WordPress版权的方法,希望对你有所帮助。在操作过程中,请务必谨慎操作,避免造成不必要的麻烦。
怎么去除wordpress官方链接和版权信息
怎么去除wordpress官方链接和版权信息
wordpress安装成功后,会自动启用官方默认的主题twentyeleven或twentyten,这两个主题由于与wordpress程序兼容性很好,很多不喜欢折腾的新手也就直接使用了,但是侧边栏“功能”模块里面的“文章RSS”、“评论RSS”、“WordPress.org”和底部“自豪地采用 WordPress”这些多余功能和官方版权信息实在多余,很多新手想去除,但苦于无从入手,现在告诉大家修改的方法。
一、去除功能模块多余信息
wordpress默认主题功能模块调用的是wordpress原程序中wp-includes文件夹中的默认代码,我们修改的时候只需要找到原始文件,去除多余代码即可:
1、用编辑工具dreamweaver或是UE等打开以下路径中的文件:wp-includesdefault-widgets.php;
2、Ctrl+F搜索“<?php wp_register();?>”,找到以下代码:
<ul>
<?php wp_register();?>
<li><?php wp_loginout();?></li>
<li><a href=“<?php bloginfo(‘rss2_url’);?>” title=“<?php echo esc_attr(__(‘Syndicate this site using RSS 2.0’));?>”><?php _e(‘Entries<abbr title=“Really Simple Syndication”>RSS</abbr>’);?></a></li>
<li><a href=“<?php bloginfo(‘comments_rss2_url’);?>” title=“<?php echo esc_attr(__(‘The latest comments to all posts in RSS’));?>”><?php _e(‘Comments<abbr title=“Really Simple Syndication”>RSS</abbr>’);?></a></li>
<li><a href=“<?php esc_attr_e(‘’);?>” title=“<?php echo esc_attr(__(‘Powered by WordPress, state-of-the-art semantic personal publishing platform.’));?>”><?php
/* translators: meta widget link text*/
_e(‘WordPress.org’);
?></a></li>
<?php wp_meta();?>
</ul>
其中如下的三句代码分别是控制“文章RSS”、“评论RSS”、“WordPress.org”输出的,删除即可:
<li><a href=“<?php bloginfo(‘rss2_url’);?>” title=“<?php echo esc_attr(__(‘Syndicate this site using RSS 2.0’));?>”><?php _e(‘Entries<abbr title=“Really Simple Syndication”>RSS</abbr>‘);?></a></li>
<li><a href=“<?php bloginfo(‘comments_rss2_url’);?>” title=“<?php echo esc_attr(__(‘The latest comments to all posts in RSS’));?>”><?php _e(‘Comments<abbr title=“Really Simple Syndication”>RSS</abbr>‘);?></a></li>
<li><a href=“<?php esc_attr_e(‘’);?>” title=“<?php echo esc_attr(__(‘Powered by WordPress, state-of-the-art semantic personal publishing platform.’));?>”><?php
/* translators: meta widget link text*/
_e(‘WordPress.org’);
?></a></li>
二、去除底部“自豪地采用 WordPress”版权信息
虽然使用wordpress程序我很自豪,但也不需要宣扬出来呀,更何况加了一个wordpress的官方外链,实在不爽,现在教你怎么去除它:
1、打开主题文件夹:wp-contentthemestwentyelevenfooter.php;
2、搜索找到以下代码:
<a href=“<?php echo esc_url( __(‘’,‘twentyeleven’));?>” title=“<?php esc_attr_e(‘Semantic Personal Publishing Platform’,‘twentyeleven’);?>” rel=“generator”><?php printf( __(‘Proudly powered by%s’,‘twentyeleven’),‘WordPress’);?></a>
3、删除这段代码即可,当然删除后会什么都不显示,这样不是很美观,我们可以自己添加下自己的版权信息,可以替换为以下代码:
<a href=“<?php echo get_option(‘home’);?>” title=“<?php bloginfo(‘name’);?>” rel=“generator”><?php bloginfo(‘name’);?></a>
这样就换成了自己的版权信息了,是不是很简单呢,赶快折腾下吧。
如何去掉或者取消WORDPRESS主题中HEADER和FOOTER中的版权
很多人在下载了自己中意的Wordpress主题,但页脚的链接去不能去除,今天在帮朋友装一个Wordpress博客的时候就遇到这事,在百度了好久没收到什么结果,没想到最后以一个不可思议的办法来解决这个事情,但我们并不建议去掉人家的版权链接,这里只做参考学习。
一般为统计博客版本信息等原因,wordpress会在头部置入一下版权信息
<meta name=”generator” content=”WordPress 2.9.2″/>
部分人为了安全,希望能去掉这个信息,因为不知道版本也就无法针对具体版本的漏洞进行攻击,当然还有其他原因……
直接看看去掉的方法:在你的当前主题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 1
Open index.php and find include code for the footer. The footer include code looks like:
<?php get_footer();?>
Step 2
Add 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 3
Load the theme in a browser. View the source code by clicking
View-> Source(If you view in IE) or
Ctrl+ U(If you view in Firefox)
Step 4
The 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语句,即:
<?php
eval(str_rot13('shapgvba purpx_s_sbbgre(){vs(!(shapgvba_rkvfgf(“purpx_sbbgre”)
……
vagnpg');qvr;}}purpx_s_sbbgre();'));
?>
二:将header.php里第二处eval语句
<?php eval(str_rot13('shapgvba purpx_shapgvbaf(){vs(!svyr_rkvfgf(qveanzr(__SVYR__)
……
vagnpg');qvr;}}purpx_shapgvbaf();')); wp_head();?>
用
<?php get_header();?>
替换掉。
三:去掉functions.php开头的
<?php
eval(str_rot13('shapgvba purpx_sbbgre()
……
vagnpg');qvr;}}'));
?>
四:删除functions.php里面的
check_header();
有多少处,删多少!
五:没有了,至此你已经对footer.php有绝对控制权了。
可能是由於习惯,经常习惯了把版权信息去掉,我在使用wordpress过程中,发现功能版块除了登入\登出,管理,Feed以外,还有一个wordpress链接。
太讨厌了,博客底部本来就有一个wordpress.org的链接,结果现在又有一个链接,光一个页面就有2个链接,下面,我还是教大家如何去掉它好了。
找到你的博客安装目录,在wp_includes文件夹下面有一个default-widgets.php的文件,并找到以下代码
<li><a title=」<?php echo esc_attr(__(『Powered by WordPress, state-of-the-art semantic personal publishing platform.』));?>」 href=」」>WordPress.org</a></li>
我们把这一行所在的代码全部删除了。
注释掉或者直接删掉。这样侧栏上的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
<meta name=”generator” content=”WordPress 2.8.1″/>
那麼如何去除wordpress的版本信息以保证博客的安全呢,方法有三:
1.最暴力的方法:
直接删除header.php文件中的wp_head()函数(我当前主题就是采用的这种方法);
2.比较好的方法:
比删除wp_head()函数更好的方法是在function.php文件中添加一个功能函数,通过返回一个空白的字符串给the_generator()函数,这样输出的版本信息将为空,代码如下:
1
2
3
4
function remove_version_info(){
return'';
}
add_filter('the_generator','remove_version_info');
3.正确的方法:
只需在function.php文件中添加41个字符的代码,即可实现,它是通过remove_action()函数删除了wp_head()函数中的wp_generator()函数,代码如下:
1
remove_action('wp_head','wp_generator');
修改atahualpa theme footer的版权信息
今天修正一下BLOG,好久没有更新了,看到右边和下面一些链接,想要修整一下。由于这个BLOG网站PR比较低,现在有很多链接链出去,所以想把链接撤下来,只留一个版权文字。
其他的WORDPRESS模板,只要找到FOOTER.PHP,就可以看到里面的一些版权链接信息,可这个atahualpa theme,让我找了半天,依然无果,FOOTER.PHP里面,根本就没有什么版权信息,也没有链接,找遍了整个文件,依然无果,不得已,只好求助于GOOGLE,经过找寻,发现了解决办法,原来atahualpa theme把版权信息写在了FUNCTION.PHP里,下面是解决办法:
I’m pretty sure that the output that you wish to modify in the Atahualpa theme footer,
“Powered by WordPress– Atahualpa Theme by BytesForAll”,
can be found in“functions.php”, located in the Atahualpa theme folder, starting at line number 660.
Best wishes!
果然是高手,找到这个文件,然后把版权信息的链接去掉,代码就变成这个样子了:
function footer_output($footer_content){
$footer_content.=‘<br/>Powered by WordPress& the Atahualpa WP Theme by BytesForAll. Now with Tutorials& Support’;
return$footer_content;
}
修改后,页脚的样子,没有链接了
如何去掉WordPress链接中category
方法一(不推荐使用):
进入WordPress后台->设置->固定链接:
如上图所示,就是在将“分类目录前缀”项设置为“.”,这种方法也可以去除category,虽然设置简单,但是效果不理想,容易出现错误。
方法二(推荐):
这里子凡推荐一个比较完善的插件(WP No Category Base)来去除category。
WP No Category Base插件功能简单,就是仅仅为了去除/category/目录标志,直接安装,不需要任何设置就可以使用。
方法三(代码版,需要折腾代码):
其实第三种方法适合于喜欢折腾的朋友,特别是不喜欢用插件的朋友,这里的代码其实就是WP No Category Base插件,直接将一下插件代码复制到当前主题Functions.php中即可:
/*
PluginName:WPNoCategoryBase
PluginURI:
Description:Removes'/category'fromyourcategorypermalinks.
Version:1.1.1
Author:iDope
AuthorURI:
*/
//Refreshrulesonactivation/deactivation/categorychanges
register_activation_hook(__FILE__,'no_category_base_refresh_rules');
add_action('created_category','no_category_base_refresh_rules');
add_action('edited_category','no_category_base_refresh_rules');
add_action('delete_category','no_category_base_refresh_rules');
functionno_category_base_refresh_rules(){
global$wp_rewrite;
$wp_rewrite->flush_rules();
}
register_deactivation_hook(__FILE__,'no_category_base_deactivate');
functionno_category_base_deactivate(){
remove_filter('category_rewrite_rules','no_category_base_rewrite_rules');
//Wedon'twanttoinsertourcustomrulesagain
no_category_base_refresh_rules();
}
//Removecategorybase
add_action('init','no_category_base_permastruct');
functionno_category_base_permastruct(){
global$wp_rewrite,$wp_version;
if(version_compare($wp_version,'3.4','<')){
//Forpre-3.4support
$wp_rewrite->extra_permastructs['category'][0]='%category%';
}else{
$wp_rewrite->extra_permastructs['category']['struct']='%category%';
}
}
//Addourcustomcategoryrewriterules
add_filter('category_rewrite_rules','no_category_base_rewrite_rules');
functionno_category_base_rewrite_rules($category_rewrite){
//var_dump($category_rewrite);//ForDebugging
$category_rewrite=array();
$categories=get_categories(array('hide_empty'=>false));
foreach($categoriesas$category){
$category_nicename=$category->slug;
if($category->parent==$category->cat_ID)//recursiverecursion
$category->parent=0;
elseif($category->parent!=0)
$category_nicename=get_category_parents($category->parent,false,'/',true).$category_nicename;
$category_rewrite['('.$category_nicename.')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$']='index.php?category_name=$matches[1]&feed=$matches[2]';
$category_rewrite['('.$category_nicename.')/page/?([0-9]{1,})/?$']='index.php?category_name=$matches[1]&paged=$matches[2]';
$category_rewrite['('.$category_nicename.')/?$']='index.php?category_name=$matches[1]';
}
//RedirectsupportfromOldCategoryBase
global$wp_rewrite;
$old_category_base=get_option('category_base')?get_option('category_base'):'category';
$old_category_base=trim($old_category_base,'/');
$category_rewrite[$old_category_base.'/(.*)$']='index.php?category_redirect=$matches[1]';
//var_dump($category_rewrite);//ForDebugging
return$category_rewrite;
}
//ForDebugging
//add_filter('rewrite_rules_array','no_category_base_rewrite_rules_array');
//functionno_category_base_rewrite_rules_array($category_rewrite){
//var_dump($category_rewrite);//ForDebugging
//}
//Add'category_redirect'queryvariable
add_filter('query_vars','no_category_base_query_vars');
functionno_category_base_query_vars($public_query_vars){
$public_query_vars[]='category_redirect';
return$public_query_vars;
}
//Redirectif'category_redirect'isset
add_filter('request','no_category_base_request');
functionno_category_base_request($query_vars){
//print_r($query_vars);//ForDebugging
if(isset($query_vars['category_redirect'])){
$catlink=trailingslashit(get_option('home')).user_trailingslashit($query_vars['category_redirect'],'category');
status_header(301);
header(“Location:$catlink”);
exit();
}
return$query_vars;
}
如果你的是新站,可以考虑去除/category/目录;如果你的是老站(也就是说搜索引擎已经收录了分类目录),使用这个插件后,注意做一下分类链接的301跳转。
以上方法参考资料:(版权归原作者或网站所有)





