Skip to content

Instantly share code, notes, and snippets.

View seoagentur-hamburg's full-sized avatar

Andreas Hecht seoagentur-hamburg

View GitHub Profile
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active May 5, 2024 06:11
UPDATE 2024/03: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# 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
########################################################################
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active April 10, 2024 06:28
6G-Firewall - Version 2019
# ----------------------------------------------------------------------
# | 6g Firewall for Security - Do not change this part @Update 2019
# ----------------------------------------------------------------------
# 6G FIREWALL/BLACKLIST - Version 2019
# @ https://perishablepress.com/6g/
# 6G:[QUERY STRINGS]
<IfModule mod_rewrite.c>
RewriteEngine On
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active November 30, 2023 15:31
Meine komplette .htaccess Datei inklusive Sicherheit, Caching, Komprimierung, WebP-Nutzung und CSS-Versionierung.
# ----------------------------------------------------------------------
# webP Grafiken statt jpgs verwenden
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
@seoagentur-hamburg
seoagentur-hamburg / .htaccess
Last active January 30, 2023 10:58
Die optimale .htaccess-Datei für mehr Speed und Sicherheit
# ----------------------------------------------------------------------
# | Komprimierung und Caching |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
#
# (!) If you don't control versioning with filename-based
# cache busting, you should consider lowering the cache times
# to something like one week.
#
@seoagentur-hamburg
seoagentur-hamburg / kill-emojis.php
Created June 25, 2017 14:41
Die Emojis ausschalten
<?php
// Ab hier kopieren
//emoji aus dem header entfernen
function ah_disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'ah_disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
@seoagentur-hamburg
seoagentur-hamburg / wp-embeds-kill.php
Last active July 14, 2021 09:16
Die WordPress-Embed-Funktion komplett ausschalten
<?php
// Ab hier kopieren
/* =============================================================================
### WordPress Embeds ausschalten
============================================================================= */
/**
* Disable embeds on init.
*
* - Removes the needed query vars.
@seoagentur-hamburg
seoagentur-hamburg / clean-head.php
Created June 25, 2017 14:44
Header bereinigen
<?php
// Ab hier kopieren
/**
* Befreit den Header von unnötigen Einträgen
*/
add_action('init', 'ah_remheadlink');
function ah_remheadlink()
{
remove_action('wp_head', 'rsd_link');
@seoagentur-hamburg
seoagentur-hamburg / clean-header.php
Created February 23, 2016 19:01
Den Header von WordPress bereinigen
<?php
//emoji aus dem header entfernen
function disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
<?php
/**
* Statische Share-Buttons für die einzelnen Artikel - Facebook, Twitter, Google + und Xing.
*
* @uses Hook "evolution_after_thumbnail()"
*/
function ah_sticky_sharebar() {
global $post;
@seoagentur-hamburg
seoagentur-hamburg / drweb-about-me-widget.php
Created February 19, 2016 17:41
Ein einfaches »About me«-Widget für die Sidebar von WordPress.
<?php
/*
Plugin Name: Dr. Web About Widget
Plugin URI: http://www.drweb.de/magazin/
Description: Zeigt eine kleine "Über mich" Box mit dem Autor-Gravatar in der Sidebar an
Author: Andreas Hecht
Author URI: http://andreas-hecht.com
Version: 0.1
*/