CALL (239) 961-8285
ENDURTECH
  • Web Services
    • Web Design
      • Design and Development
      • Web Consulting and Tutoring
      • Hosting and Maintenance
      • Project Portfolio
    • Media
      • Photo and Audio, Video Editing
      • Social Media Management
      • All Web Related Services
    • Marketing
      • Digital Marketing and Branding
      • Search Engine Optimization
    • Client Portal
      • Remote Web Support
      • Web Services Payment
      • Scheduled Payments
  • Tech Support
    • Services
      • Computer Support and Repair
      • Data Backup and Recovery
      • Computer Security, Virus Removal
      • Computer Networking Support
      • Computer Consulting & Tutoring
      • All Technology Related Services
    • Blockchain
      • Blockchain Technology
      • Cryptocurrency Articles
    • Client Portal
      • Remote PC Support
      • Remote Monitoring & Management
      • Tech Services Payment
  • Articles
  • About
  • Talk to Me
  • Menu Menu

Securing Your WordPress Includes Folder

Security, Web Security, WordPress

There are scripts within WordPress that are not intended to be accessed by most users. To prevent such access we can block these scripts by using “mod_rewrite” via our servers’ .htaccess file.

 

[su_note note_color=”#157BAE” text_color=”#ffffff” radius=”5″]Would you like prompt assistance? If you don’t have time or are not comfortable taking the risk of adding custom code to your website, let me help get this done for you now![/su_note]

 

Securing wp-includes #

Access your website server parent directory and add the following code to your .htaccess file. Be sure to insert this code outside of the “# BEGIN WordPress” and “# END WordPress” tags. Otherwise they might be overwritten upon an update.

 

# Block Include-Only File Access
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]
</IfModule>

 

Code Explanation #

LINE 1: Checks whether module mod_rewrite.c is available.

LINE 2: Activates Apache’s rewrite module, if not already activated. Can be omitted if it has been previously turned on but won’t hurt to keep it in place.

LINE 3: Defines the root directory as the directory where the rules should be rewritten.

LINE 4: Using the [F] flag, at the end of the rule, causes the server to return a 403 Forbidden status code to the client. When using [F], an [L] is implied which returns the response immediately and no other rules are evaluated. Thus this line of code blocks access to the “wp-admin/includes” directory and not the entire wp-admin directory.

LINE 5: The [ ! ] exclamation point at the beginning of this line signifies NOT. So, if we are NOT in the wp-includes folder. The [S] flag is used to skip rules. The syntax of the skip flag is [S=N], where N signifies the number of rules to skip (provided the RewriteRule matches). Thus this line may be translated as follows, if we are not in the wp-includes folder skip the next three rules (see below).

LINE 6: RewriteRule ^wp-includes/[^/]+\.php$ – [F,L]

LINE 7: RewriteRule ^wp-includes/js/tinymce/langs/.+\.php – [F,L]

LINE 8: RewriteRule ^wp-includes/theme-compat/ – [F,L]

All three lines above (if not skipped in the previous rule) would return a 403 Forbidden status code to the client browser thus blocking access to listed rule directories.

Multisite WordPress #

If your WordPress website is on “Multisite” mode you’ll need to comment out the third rule (LINE 6): RewriteRule ^wp-includes/[^/}+\.php$ - [F,L]

Comment out the rule by adding a pound sign ( # ) to the beginning of the line. Otherwise this will prevent ms-files.php (which resides in your wp-includes folder) from executing and generating needed images. Omitting that line will allow the file to execute and function as needed but don’t provide the full protection originally intended.

When in doubt about security, ensure your plugins and WordPress core files are up to date. Consider hiring me to manage, maintain and secure your WordPress web site for you.

End of File #

I hope this article on securing your WordPress includes folder has helped provide you with greater security on your existing and future WordPress web sites.

You can support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.

Let me know if you found any errors within my article or if I may assist you by answering any additional questions you may have.

 

August 22, 2018
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://endurtech.com/wp-content/uploads/2018/04/wordpress-content-management-system.jpg 512 512 Manny https://endurtech.com/wp-content/uploads/2018/04/endurtech-logo.png Manny2018-08-22 15:58:052019-11-19 20:53:35Securing Your WordPress Includes Folder
Search Search

CONNECT WITH US

This field is for validation purposes and should be left unchanged.
Engagement*

Want to say, "thanks"?
Leave me a review on Facebook and/or Google.

You can send me a tip using your Brave browser. Get Brave!

Only used to send you a receipt.
Include a Message
Popular
  • Windows Logo
    Second Monitor on Windows 10 Resets After SleepJuly 2, 2020 - 6:30 am
  • Windows Logo
    How to Disable the F1 Help Key in Windows 10April 15, 2021 - 2:40 pm
  • Cortana Logo
    How to Disable Microsoft’s CortanaApril 6, 2021 - 9:00 am
  • Firefox Logo
    How to Remove All Passwords from Lockwise in FirefoxMarch 26, 2020 - 11:00 am
Recent
  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar Err...July 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

STAY IN TOUCH

ENDURTECH Web Design Company Naples, Florida

Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Learn More & Connect

Search Search
ENDURTECH Logo
Endurtech GitHub ProfileEndurtech YouTube ChannelEndurtech LinkedIn ProfileEndurtech Facebook Page

5 Star Google Review for Endurtech - Naples Web Design Company

Latest Articles

  • How to Fix Brother BrLog Errors
    How to Fix Brother BrLog ErrorsAugust 24, 2026 - 10:55 am
  • How to block Facebook crawler
    List of Spider Crawlers to BlockAugust 10, 2026 - 9:20 am
  • Brave Browser Logo
    How to Fix the “Not Secure” Address Bar ErrorJuly 20, 2026 - 12:48 pm
  • Linkpull Extension By Endurtech
    LinkPull Extension, Grab Any File From a URLJuly 7, 2026 - 7:35 pm

Recent Projects

  • Jewelry Website Gems of Note
    Gems of NoteNovember 15, 2019 - 10:16 pm
  • Gift Store Facebook Business Page Cover Video
    Gift Store Facebook Business Page Cover VideoApril 13, 2019 - 3:58 pm
  • Toledo Yoga BrandBot Footer Integration
    Toledo YogaApril 9, 2019 - 7:26 am
  • Lawyer Association Website with Member Portal
    National Employment Lawyers Association, Florida ChapterFebruary 26, 2019 - 8:00 am

Business Details

Mondays - Fridays
9:00 am - 5:00 pm
Eastern Standard Time
After hours by appointment

SUPPORT PHONE

(239) 961-8285

MAILING ADDRESS

59 Logan Ln.
Lynchburg, VA 24502

Copyright © 2026 ENDURTECH ® All Rights Reserved. Legal
Link to: New Confidential Mode in Gmail Link to: New Confidential Mode in Gmail New Confidential Mode in GmailGmail New Confidential Message Feature Link to: How to Open EPS Files Created in Newer Version of Illustrator Link to: How to Open EPS Files Created in Newer Version of Illustrator Converting an EPS File to Adobe IllustratorHow to Open EPS Files Created in Newer Version of Illustrator
Scroll to top Scroll to top Scroll to top