How to hide Wordpress details from view source cod

2020-07-18 03:36发布

问题:

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.

回答1:

You can hide WordPress in a few ways. 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.



回答2:

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:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^modules/(.*) /wp-content/plugins/$1 [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

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:

  • 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


回答3:

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).

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

  1. Ability to hide both http://yoursite.com/wp-login.php page 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.

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



标签: php wordpress