php 如何从查看源代码中隐藏 Wordpress 详细信息

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14230411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 06:53:30  来源:igfitidea点击:

How to hide Wordpress details from view source code

phpwordpress

提问by varun kumar

I have a wordpress site ,but when I Press Ctrl+U I can see all the site information's about my site(themes,wp-content,etc). But I saw one site http://www.indiavisiontv.com/. when I press Ctrl+U we get a source code page that doesn't reveal so much things. How they do that.

我有一个 wordpress 站点,但是当我按 Ctrl+UI 时,可以看到有关我站点的所有站点信息(主题、wp 内容等)。但我看到了一个网站http://www.indiavisiontv.com/。当我按 Ctrl+U 时,我们会得到一个源代码页,它不会显示太多内容。他们是如何做到的。

回答by donlaur

You can hide WordPress in a few ways. http://www.graemeboy.com/how-to-hide-that-you-use-wordpress

您可以通过几种方式隐藏 WordPress。 http://www.graemeboy.com/how-to-hide-that-you-use-wordpress

Removing the generator tag is a big one that some security plugins do to help with random searching for outdated installs to hack. You can also rename the directories that give WP away.

删除生成器标签是一项重要的工作,一些安全插件可以帮助随机搜索过时的安装以进行黑客攻击。您还可以重命名提供 WP 的目录。

回答by WP-Silver

If you are new to php and mod_rewrite i suggest so you check with the section of my response. Or if you keen to try it yourself, you can use something like this to hide the wp-content/plugins path structure:

如果您不熟悉 php 和 mod_rewrite,我建议您查看我的回复部分。或者,如果您热衷于自己尝试,您可以使用这样的东西来隐藏 wp-content/plugins 路径结构:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^modules/(.*) /wp-content/plugins/ [L,QSA]
</IfModule>

This will change the path to /modules . Apply something similar to other structure, you may need some advanced rewrites, see http://httpd.apache.org/docs/current/mod/mod_rewrite.html

这将更改 /modules 的路径。应用类似于其他结构的东西,您可能需要一些高级重写,请参阅http://httpd.apache.org/docs/current/mod/mod_rewrite.html

If prefer something out of the box, there re few interesting plugins, some commercial, also free at WordPress repository, i suggest to try WP Hide & Security Enhancer. This include lot's of things and help to change pretty much everything to make your WordPress unrecognizable. Here are some features of the code:

如果喜欢开箱即用的插件,很少有有趣的插件,一些商业插件,在 WordPress 存储库中也是免费的,我建议尝试WP Hide & Security Enhancer。这包括很多东西,有助于改变几乎所有的东西,让你的 WordPress 无法识别。以下是代码的一些特点:

  • Custom admin Url
  • Block default admin Url
  • Block any direct folder access to completely hide the structure
  • Custom wp-login.php filename
  • Block default wp-login.php
  • Block default wp-signup.php
  • Adjustable theme url
  • New child theme url
  • Change theme style file name
  • Custom wp-include
  • Block default wp-include paths
  • Block defalt wp-content
  • Custom plugins urls
  • Block default plugins paths
  • New upload url
  • Block default upload urls
  • Remove wordpress version
  • Meta Generator block
  • Disble the emoji and required javascript code
  • Remove wlwmanifest Meta
  • Remove rsd_link Meta
  • Remove wpemoji
  • 自定义管理网址
  • 阻止默认管理员 URL
  • 阻止任何直接文件夹访问以完全隐藏结构
  • 自定义 wp-login.php 文件名
  • 阻止默认 wp-login.php
  • 阻止默认 wp-signup.php
  • 可调整的主题网址
  • 新的子主题网址
  • 更改主题样式文件名
  • 自定义 wp-include
  • 阻止默认的 wp-include 路径
  • 阻止默认 wp 内容
  • 自定义插件网址
  • 阻止默认插件路径
  • 新上传网址
  • 阻止默认上传网址
  • 删除 wordpress 版本
  • 元生成器块
  • 禁用表情符号和所需的 javascript 代码
  • 删除 wlwmanifest Meta
  • 删除 rsd_link 元
  • 删除 wpemoji

回答by Anon

The website you have mentioned (indiavision) is using w3 total cache to minify the css and js hence you can't see the typical source (I was still able to locate 'wp-content' in source though).

您提到的网站(indiavision)正在使用 w3 总缓存来缩小 css 和 js,因此您看不到典型的源代码(尽管我仍然能够在源代码中找到“wp-content”)。

You can use Hide my wpto hide your wordpress instance completely. It includes following abilities:

您可以使用Hide my wp来完全隐藏您的 wordpress 实例。它包括以下能力:

  1. Ability to hide both http://yoursite.com/wp-login.phppage and http://yoursite.com/wp-admin/area.
  2. Ability to remove auto generated feed from header.
  3. Ability to clean automatic classess added by wordpress (won't recommend this personally)
  4. Ability to disallow direct access to php files (except the ones in wp-admin)
  5. Ability to change pagination url.
  6. Ability to disable Archives.
  7. Ability to completely disable queries for taxonomies, comments and attachments.
  1. 能够隐藏http://yoursite.com/wp-login.php页面和http://yoursite.com/wp-admin/区域。
  2. 能够从标题中删除自动生成的提要。
  3. 能够清理 wordpress 添加的自动类(个人不推荐)
  4. 能够禁止直接访问 php 文件(wp-admin 中的除外)
  5. 能够更改分页网址。
  6. 能够禁用档案。
  7. 能够完全禁用对分类法、评论和附件的查询。

Reference: http://howtomakewebsite.ws/wordpress-plugins/how-to-hide-wordpress/731/

参考:http: //howtomakewebsite.ws/wordpress-plugins/how-to-hide-wordpress/731/