Skip to content

Instantly share code, notes, and snippets.

@ted81das
ted81das / List.md
Created February 7, 2024 09:38 — forked from napsterrahul/List.md
List of open source projects made with Laravel
@ted81das
ted81das / wp-security
Last active September 21, 2021 08:15
Restrict access to wp-includes
# Block wp-includes folder and files
<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]
You don't need to create an extra file for that. Simply place something like the following into your themes functions.php file:
function grab_my_very_own_webhook(){
if( ! isset( $_GET['whateveriwant'] ) ){
return;
}
//create your own logic here
//in wp-config.php
define( 'DISALLOW_FILE_EDIT', true );
To protect your website from backdoor access files, you need to create a .htaccess file and upload it to your site’s /wp-includes/ and /wp-content/uploads/ directories.
Simply create a blank file on your computer by using a text editor like Notepad (TextEdit on Mac). Save the file as .htaccess and paste the following code inside it.
1
2
3
<Files *.php>
deny from all