InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Wordpress security tutorials

  • prevent access to php files in wp-includes
  • prevent wordpress xmlrpc.php attack
 
  • Home
  • > Tutorials
  • > Wordpress
  • > Wordpress Security

WordPress – prevent access to php files in wp-includes

on Feb 19, 2016

Most wordpress php files are in directory wp-includes in wordpress root directory. This can be used by hackers to try to access these directly. This may lead to unnecessary errors in apache error log file also.

In case you are using WordPress with Apache, you can use the following configuration in apache conf file to prevent access to these php files.

RewriteEngine on
RewriteRule ^/wp-includes/[^/]*\.php$   - [L,R=403]

Or alternatively you can add the following to .htaccess

RewriteEngine on
RewriteRule ^wp-includes/[^/]*\.php$   - [R=403,L]

Now try to access url /wp-includes/class-wp.php. You should be able to see the following access denied page.
wordpress-protect-wp-includes-php-files-403

Suggested posts:

  1. How to list git branches
  2. Linux – find files containing specific text
  3. PHP sort associative array using custom compare function
  4. Using Google analytics SDK v2 for android app real time tracking
  5. How to zip/unzip a directory with password
  6. Disable directory listing in apache
  7. WordPress – get wpdb class method names
  8. Find which process is listening on a port on Linux
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Apache, Linux, Tutorials, Web Security, Wordpress, Wordpress Security
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress