This guide summarizes the files and methodology used for advanced hardening, performance tuning, and cleanup of a WordPress installation.
This file is the primary layer for security and performance at the server level.
- 🛡️ Security Hardening:
| # Kirby .htaccess | |
| # rewrite rules | |
| <IfModule mod_rewrite.c> | |
| # enable awesome urls. i.e.: | |
| # http://yourdomain.com/about-us/team | |
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} !=localhost |
| <?php | |
| /** | |
| * Title: Event Card | |
| * Slug: text-domain/event-card | |
| * Categories: cards | |
| */ | |
| ?> | |
| <!-- wp:group {"className":"specifica-opera","layout":{"type":"default"}} --> | |
| <div class="wp-block-group specifica-opera"><!-- wp:heading {"textColor":"hc_azzurro"} --> | |
| <h2 class="has-hc-azzurro-color has-text-color">Missa Brevis in La Maggiore BWV 234</h2> |
| <?php | |
| function custom_post_types() { | |
| // Events | |
| register_post_type('event', array( | |
| 'public' => true, | |
| 'capability_type' => 'event', | |
| 'map_meta_cap' => true, | |
| 'show_in_rest' => true, | |
| 'has_archive' => true, |
This guide summarizes the files and methodology used for advanced hardening, performance tuning, and cleanup of a WordPress installation.
This file is the primary layer for security and performance at the server level.
| <?php | |
| /* | |
| Plugin Name: Disable REST API for anonymous users | |
| */ | |
| /** | |
| * Remove all endpoints except SAML / oEmbed for unauthenticated users | |
| */ | |
| add_filter( 'rest_authentication_errors', function($result) { | |
| if ( ! empty( $result ) ) { |
| ######################################################################## | |
| # OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.9 - 03/2024 | |
| # ---------------------------------------------------------------------- | |
| # @Author: Andreas Hecht | |
| # @Author URI: https://seoagentur-hamburg.com | |
| # License: GNU General Public License v2 or later | |
| # License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
| ######################################################################## | |
| <?php //remove this line | |
| add_filter( 'comment_form_defaults', 'cd_pre_comment_text' ); | |
| /** | |
| * Change the text output that appears before the comment form | |
| * Note: Logged in user will not see this text. | |
| * | |
| * @author Carrie Dils <http://www.carriedils.com> | |
| * @uses comment_notes_before <http://codex.wordpress.org/Function_Reference/comment_form> | |
| * |