1. Performance-Analyse & Messung
Das Performance-Problem erkennen
"Meine WordPress-Seite ist langsam" - das höre ich mindestens 3x pro Woche. Aber WAS genau ist langsam? Der Server? Die Datenbank? Riesige Bilder? Schlecht programmierte Plugins? Ohne Messung ist Optimierung nur Raterei.
❌ Typische Performance-Killer:
- • Unkomprimierte 5MB+ Bilder direkt vom Handy
- • 50+ aktive Plugins ohne Notwendigkeit
- • Datenbank mit 100.000+ Revisionen und Spam-Kommentaren
- • Shared Hosting mit 256MB RAM-Limit
- • Themes mit 20+ CSS/JS-Dateien
- • Keine Caching-Strategie
Performance-Tools & Messung
🔥 Essential Tools
- • Google PageSpeed Insights: Core Web Vitals offiziell
- • GTmetrix: Detaillierte Waterfall-Analyse
- • Query Monitor Plugin: Langsame DB-Queries finden
- • WebPageTest: Weltweite Test-Locations
⚡ Advanced Tools
- • Lighthouse CLI: Automatisierte Tests
- • New Relic: Server-Performance Monitoring
- • P3 Plugin Profiler: Plugin-Impact messen
- • Chrome DevTools: Real-User Performance
Baseline-Messung durchführen
# 1. PageSpeed Insights Test https://pagespeed.web.dev/analysis?url=https://yoursite.com # 2. GTmetrix Detailanalyse https://gtmetrix.com/ # Wichtige Metriken: # - Largest Contentful Paint (LCP): < 2.5s # - First Input Delay (FID): < 100ms # - Cumulative Layout Shift (CLS): < 0.1 # 3. WordPress Query Monitor aktivieren # wp-admin/plugins.php -> Query Monitor installieren # Checken: Database Queries, PHP Errors, Slow Queries # Wenn du final fertig bist, Query Monitor wieder deinstallieren! # 4. Du kannst auch diverse APIs für automatisierte Tests nutzen # oft benötigst du aber einen Account / Key oder node.js # Beispiel: Lighthouse CLI mit node.js npm install -g lighthouse lighthouse https://yoursite.com --output html --output-path report.html # 5. Baseline dokumentieren # Vor Optimierung: # - LCP: 4.2s # - FID: 180ms # - CLS: 0.15 # - DB Queries: 47 # - Page Size: 3.2MB
und Google legt da mitlerweile sehr viel Wert drauf!
Core Web Vitals verstehen
| Metrik | Was es misst | Zielwert | Hauptursachen |
|---|---|---|---|
| LCP | Ladezeit des größten sichtbaren Elements | < 2,5s | Langsamer Server, blockierende Ressourcen |
| FID | Zeit bis zur ersten Nutzer-Interaktion | < 100ms | Schweres JavaScript, blockierender Hauptthread |
| CLS | Stabilität des Layouts (Verschiebungen) | < 0,1 | Bilder ohne Dimensionen, Web-Fonts |
| INP | Reaktionszeit bei Nutzer-Interaktionen | < 200ms | Lange JavaScript-Ausführungszeiten |
💡 Praxis-Fall: Client-Website Optimierung
Ausgangslage: WooCommerce-Shop mit 8,4s Ladezeit, LCP bei 6,2s.
Nach 2-tägiger Optimierung: 1,2s Ladezeit, LCP bei 1,8s.
📊 Ergebnisse nach Optimierung:
• Ladezeit: 8,4s → 1,2s (-86%)
• LCP: 6,2s → 1,8s (-71%)
• DB Queries: 89 → 23 (-74%)
• Page Size: 4,7MB → 850KB (-82%)
• PageSpeed Score: 23 → 95 (+313%)
📈 Langfristige Auswirkungen (nach 2 Monaten):
• Conversion-Rate: +15% (gemessen über 4 Wochen)
• Google Rankings: +3-5 Positionen (durchschnittlich)
• Bounce-Rate: -18%
2. Caching-Strategien & WP Rocket
Die Caching-Hierarchie verstehen
Caching funktioniert in Ebenen. Je näher am Nutzer, desto schneller. Die meisten WordPress-Admins nutzen nur eine Ebene - verschenken damit massives Performance-Potenzial:
1. Browser Cache (Client-Side)
Static Assets direkt im Browser speichern
2. CDN Cache (Edge Locations)
Cloudflare, MaxCDN, KeyCDN für globale Verfügbarkeit
3. Page Cache (WordPress-Plugin)
WP Rocket, W3 Total Cache, WP Super Cache
4. Object Cache (Database)
Redis, Memcached für häufige DB-Queries
5. OPcode Cache (PHP)
OPcache für kompilierten PHP-Code
WP Rocket: Optimale Konfiguration 2025
**⚠️ Wichtige Erkenntnis:** WP Rocket hat seit 2020 kaum neue Features veröffentlicht und hat Probleme mit LCP, TTFB und Mobile-Performance. Viele Experten empfehlen FlyingPress oder LiteSpeed Cache als bessere Alternativen.
## WP Rocket: Optimale Konfiguration 2025 ### // WP Rocket Optimale Settings (wp-admin/options-general.php?page=wprocket) ### // 1. Cache Tab ✅ **Enable Caching for mobile devices** - aktiviert Caching für Mobilgeräte ❌ **Enable Caching for logged-in WordPress users** - nur aktivieren bei bbPress oder user-spezifischen Inhalten (erhöht CPU-Verbrauch) ✅ **Cache Lifespan: 24 hours** - niedrigere Werte = häufigeres Cache-Refresh, höhere Werte = weniger CPU-Verbrauch ### // 2. File Optimization ✅ **CSS Files: Minify CSS files** - Whitespace entfernen ❌ **CSS Files: Combine CSS files** - funktioniert nicht mit "Delay JavaScript", problematisch bei HTTP/2/3 ❌ **CSS Files: Optimize CSS delivery (Remove Unused CSS)** - lädt CSS inline (langsamer), besser: Perfmatters verwenden ✅ **JavaScript Files: Minify JavaScript files** - Code komprimieren ❌ **JavaScript Files: Combine JavaScript files** - problematisch bei großen Dateien und HTTP/2/3 ✅ **JavaScript Files: Load JavaScript deferred** - nach DOM-Parsing laden ✅ **JavaScript Files: Delay JavaScript execution** - bis User-Interaktion verzögern ### // 3. Media Tab ✅ **LazyLoad: Enable for images** - Bilder verzögert laden ✅ **LazyLoad: Enable for iframes and videos** - Videos verzögert laden ✅ **LazyLoad: Replace YouTube iframe with preview image** - YouTube-Optimierung ✅ **WebP Compatibility: Enable** - Moderne Bildformate ### // 4. Preload Tab ✅ **Preload Cache: Enable** - Cache vorladen ✅ **Preload Links: Enable** - Links vorladen ✅ **Preload Cache: Sitemap-based preloading** - wenn Sitemap vorhanden ✅ **Preload Bot: 2 links per minute** - Server nicht überlasten ### // 5. Advanced Rules ❌ **Critical CSS Path** - WP Rocket lädt CSS inline (langsamer), besser: Perfmatters mit externer Datei ### // 6. CDN Tab ❌ **RocketCDN** - nur StackPath CDN, keine Full-Page-Caching, keine Mobile-Image-Resizing ### // 7. Zusätzliche Plugins benötigt Da WP Rocket viele Features fehlen, brauchst du zusätzlich: - **Perfmatters** - für besseres CSS-Management und Core Web Vitals - **Async JavaScript** - für bessere JavaScript-Optimierung - **BunnyCDN/Cloudflare** - für bessere CDN-Performance - **Image Optimization Plugin** - für Mobile-Image-Resizing ### // 8. Alternative Empfehlung **FlyingPress** oder **LiteSpeed Cache** bieten bessere Core Web Vitals Optimierung und mehr Features ohne zusätzliche Plugins.
Object Cache mit Redis implementieren
# 1. Redis Server installieren (Ubuntu/Debian)
sudo apt update
sudo apt install redis-server
# Redis konfigurieren
sudo nano /etc/redis/redis.conf
# Ändern:
maxmemory 256mb
maxmemory-policy allkeys-lru
# Redis starten und aktivieren
sudo systemctl start redis-server
sudo systemctl enable redis-server
# 2. WordPress Redis Plugin installieren
# wp-admin/plugins.php -> "Redis Object Cache" by Till Krüss
# 3. wp-config.php anpassen
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_TIMEOUT', 1);
define('WP_REDIS_READ_TIMEOUT', 1);
define('WP_REDIS_DATABASE', 0);
# 4. Redis-Verbindung testen
redis-cli ping
# Sollte "PONG" antworten
# 5. Redis Object Cache aktivieren
# wp-admin/options-general.php?page=redis-cache -> "Enable Object Cache"
# Performance-Monitoring
redis-cli info memory
redis-cli info keyspaceCDN Integration: Cloudflare Setup 2025
## CDN Integration: Cloudflare Setup 2025 ### # 1. Cloudflare Account erstellen & Domain hinzufügen - **Registrierung:** https://dash.cloudflare.com/sign-up - **DNS:** Cloudflare's DNS verwenden (einer der schnellsten auf dnsperf.com) - **Vorteil:** Schneller als GoDaddy/NameCheap, reduziert TTFB ### # 2. DNS-Records zu Cloudflare übertragen - **Alle A, AAAA, CNAME Records** kopieren - **Orange Cloud aktivieren** für Web-Traffic (Proxied-Modus) - **Wichtig:** Nur "Proxied" ermöglicht APO, Argo, Load Balancing, Zaraz ### # 3. Optimale Cloudflare Settings für WordPress #### **SSL/TLS Settings:** - **SSL/TLS Mode:** Full Strict (beste Sicherheit) - **Always Use HTTPS:** ON (HTTP zu HTTPS Redirect) - **HSTS:** Enable mit 6 Monaten Max Age - **TLS:** 1.3 aktivieren, Minimum 1.2 #### **Speed Settings:** - ✅ **Auto Minify:** CSS, JavaScript, HTML - ✅ **Brotli Compression:** ON (schneller als GZIP) - ✅ **Early Hints:** ON (preload/preconnect Hints) - ✅ **Enhanced HTTP/2 Prioritization:** ON - ✅ **TCP Turbo:** ON (automatische TCP-Optimierung) - ✅ **HTTP/3 with QUIC:** ON - ❌ **Rocket Loader:** OFF (verursacht oft Fehler) #### **Caching Settings:** - **Caching Level:** Standard - **Browser Cache TTL:** 1 Jahr (Google-Empfehlung für statische Assets) - **Crawler Hints:** ON (optimiert Crawling) #### **Security Settings:** - ✅ **Bot Fight Mode:** ON (blockiert schlechte Bots) - ✅ **Browser Integrity Check:** ON - ✅ **Email Address Obfuscation:** ON - ✅ **Hotlink Protection:** ON #### **Image Optimization:** - ✅ **Polish:** ON (Komprimierung + WebP-Konvertierung) - ✅ **Mirage:** ON (Optimierung für langsame Verbindungen) - ✅ **Image Resizing:** ON (WebP/AVIF-Konvertierung) ### # 4. APO (Automatic Platform Optimization) - ✅ **APO aktivieren:** HTML von Cloudflare's Netzwerk servieren - **Vorteil:** Reduziert TTFB, LCP für Besucher weit vom Origin-Server - **Setup:** API Token erstellen und in Cloudflare Plugin eingeben - **Wichtig:** Page Caching im Cache-Plugin aktiviert lassen ### # 5. Page Rules (wichtigste für WordPress) yoursite.com/wp-admin/* Cache Level: Bypass yoursite.com/wp-content/* Cache Level: Cache Everything Edge Cache TTL: 1 month Browser Cache TTL: 4 hours yoursite.com/wp-includes/* Cache Level: Cache Everything Edge Cache TTL: 1 month ### # 6. Zaraz (Third-Party Scripts) - **Google Analytics, Facebook Pixel** zu Zaraz hinzufügen - **Vorteil:** Third-Party Scripts werden von Cloudflare geladen - **Setup:** Tracking-ID eingeben, IP-Anonymisierung aktivieren ### # 7. Firewall Rules (optional) Block XML-RPC: (http.request.uri contains "/xmlrpc.php") Block wp-login Brute Force: (http.request.uri contains "/wp-login.php") and (ip.src ne 192.168.1.1) ### # 8. WP Rocket + Cloudflare Plugin - **Plugin installieren:** wp-admin/plugins.php - **API Token:** Aus Cloudflare Dashboard holen - **Automatic Cache Purge:** aktivieren - **Wichtig:** Beide Caching-Layer aktiviert lassen ### # 9. Cache-Headers optimieren # .htaccess <IfModule mod_expires.c> ExpiresActive On ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/webp "access plus 1 year" ExpiresByType font/woff "access plus 1 year" ExpiresByType font/woff2 "access plus 1 year" </IfModule> ### # 10. Performance-Monitoring - **KeyCDN Performance Test:** TTFB in 40 globalen Standorten testen - **PageSpeed Insights:** Core Web Vitals überwachen - **Cloudflare Analytics:** Bandwidth-Einsparungen verfolgen ### # 11. Erweiterte Features (Paid Plans) - **Argo + Tiered Cache:** Schnellste Netzwerk-Pfade - **Load Balancing:** Failover für Origin-Server - **SXGs:** Prefetching für Google-Suchergebnisse
3. Database-Optimierung
⚠️ WICHTIG: Sicherheitshinweis
Datenbank-Optimierung ist risikobehaftet! Erstelle IMMER ein vollständiges Backup vor jeder Änderung. WP Engine empfiehlt, diese Operationen nur in einer Testumgebung durchzuführen. Bei Managed Hosting (WP Engine, Kinsta, etc.) kontaktiere den Support für professionelle Optimierung.
Database-Analyse SQL Queries
### # 1. Erweiterte Tabellen-Analyse
SELECT
table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)",
table_rows as "Rows",
ROUND((data_free / 1024 / 1024), 2) AS "Free Space (MB)"
FROM information_schema.TABLES
WHERE table_schema = "your_database_name"
ORDER BY (data_length + index_length) DESC;
### # 2. Post-Revisionen & Autosaves analysieren
SELECT post_type, COUNT(*) as count
FROM wp_posts
WHERE post_type IN ('revision', 'auto-draft')
GROUP BY post_type;
### # 3. Spam & Trash Comments
SELECT
comment_approved,
COUNT(*) as count,
ROUND(AVG(LENGTH(comment_content))/1024, 2) as avg_size_kb
FROM wp_comments
GROUP BY comment_approved;
### # 4. Verwaiste Metadaten finden
-- Verwaiste Postmeta
SELECT COUNT(*) as orphaned_postmeta FROM wp_postmeta pm
LEFT JOIN wp_posts p ON pm.post_id = p.ID
WHERE p.ID IS NULL;
-- Verwaiste Termmeta (neu)
SELECT COUNT(*) as orphaned_termmeta FROM wp_termmeta tm
LEFT JOIN wp_terms t ON tm.term_id = t.term_id
WHERE t.term_id IS NULL;
### # 5. Autoload-Optimierung (aktualisierte Schwellwerte)
-- Große Autoload-Optionen identifizieren (>100KB)
SELECT
option_name,
LENGTH(option_value) as value_length,
autoload,
ROUND(LENGTH(option_value)/1024, 2) as size_kb
FROM wp_options
WHERE autoload = 'yes'
AND LENGTH(option_value) > 102400 -- 100KB
ORDER BY value_length DESC
LIMIT 20;
### # 6. Index-Analyse & Optimierung
-- Redundante Indizes identifizieren
SELECT table_name, index_name, column_name
FROM information_schema.statistics
WHERE table_schema = 'your_database_name'
GROUP BY table_name, index_name, column_name
HAVING COUNT(*) > 1;
-- Index-Nutzung analysieren
SELECT
table_name,
index_name,
stat_value as uses
FROM mysql.innodb_index_stats
WHERE stat_name = 'n_leaf_pages'
ORDER BY stat_value DESC;
### # 7. InnoDB Optimierung
-- Table Status prüfen
SHOW TABLE STATUS
WHERE Engine = 'InnoDB'
AND (Data_free > 0 OR Update_time < NOW() - INTERVAL 30 DAY);
### # 8. Buffer Pool Monitoring
SHOW GLOBAL STATUS WHERE Variable_name IN
('Innodb_buffer_pool_pages_total',
'Innodb_buffer_pool_pages_free',
'Innodb_buffer_pool_read_requests',
'Innodb_buffer_pool_reads');
### # 9. Query Performance
-- Langsame Queries mit Details
SELECT
query_time,
rows_examined,
rows_sent,
sql_text
FROM mysql.slow_log
WHERE start_time > DATE_SUB(NOW(), INTERVAL 1 DAY)
AND sql_text NOT LIKE '%INFORMATION_SCHEMA%'
ORDER BY query_time DESC
LIMIT 10;
### # 10. Gesamte Autoload-Datengröße
-- WP Engine 2024/25: Warnung bei >500KB
SELECT SUM(LENGTH(option_value))/1024 as total_autoload_kb
FROM wp_options
WHERE autoload = 'yes';
### # 11. Transients aufräumen
-- Abgelaufene Transients finden
SELECT option_name, option_value
FROM wp_options
WHERE option_name LIKE '%_transient_timeout_%'
AND option_value < UNIX_TIMESTAMP();
### # 12. Große Metadaten identifizieren
SELECT
meta_key,
COUNT(*) as count,
ROUND(AVG(LENGTH(meta_value))/1024,2) as avg_size_kb,
ROUND(SUM(LENGTH(meta_value))/1024/1024,2) as total_size_mb
FROM wp_postmeta
GROUP BY meta_key
HAVING total_size_mb > 1
ORDER BY total_size_mb DESC;💡 WP Engine Best Practices 2025
- InnoDB Storage Engine: Ausschließlich InnoDB verwenden (bessere Performance, Row-Level-Locking)
- Object Cache: Redis bevorzugt, 500KB Autoload-Limit (reduziert von 800KB)
- Search-Optimierung: ElasticPress/Algolia ab 500+ Posts (war: 1000+)
- Autoload-Optimierung: Große Optionen (>100KB) auf autoload="no" setzen
- Index-Strategie: Regelmäßige Index-Nutzungsanalyse, unused indexes entfernen
- Monitoring: Slow Query Log + Performance Schema aktivieren
🔧 Sichere Database-Cleanup Plugins
- WP-Optimize: Automatische Optimierung mit Backup-Funktion
- WP Rocket: Database-Optimierung integriert
- Perfmatters: Autoload-Optimierung und Query-Monitoring
- Query Monitor: Detaillierte Query-Analyse und Performance-Insights
4. Media & Image-Optimierung
WebP Image-Optimierung
# WebP-Unterstützung aktivieren
# .htaccess WebP-Fallback
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{REQUEST_FILENAME} \.(jpe?g|png)$
RewriteCond %{REQUEST_FILENAME}\.webp -f
RewriteRule ^(.+)\.(jpe?g|png)$ $1.$2.webp [T=image/webp]
# WebP-Konvertierung
find /var/www/html/wp-content/uploads -name "*.jpg" -exec cwebp -q 85 {} -o {}.webp \;
# PHP-Code für automatische WebP-Generierung
function generate_webp_on_upload($metadata, $file_id) {
$file = get_attached_file($file_id);
$info = pathinfo($file);
if (in_array(strtolower($info['extension']), ['jpg', 'jpeg', 'png'])) {
$webp_file = $info['dirname'] . '/' . $info['filename'] . '.webp';
$image = new Imagick($file);
$image->setImageFormat('webp');
$image->setImageCompressionQuality(85);
$image->writeImage($webp_file);
}
return $metadata;
}
add_filter('wp_generate_attachment_metadata', 'generate_webp_on_upload', 10, 2);5. Plugin & Theme Performance
Plugin-Performance analysieren & optimieren
Plugins sind oft der Hauptgrund für langsame WordPress-Seiten. Mit Query Monitor habe ich bei einem Client 47% der Ladezeit allein durch ineffiziente Plugin-Queries verursacht gefunden. Hier ist dein Action-Plan für schnellere Plugins:
# 1. Plugin Impact messen mit Query Monitor
- Query Monitor Plugin installieren
- Langsame Queries identifizieren
- Plugin-spezifische Ladezeiten analysieren
# 2. Plugin-Audit durchführen
wp plugin list --format=csv > plugin-audit.csv
# Prüfen für jedes Plugin:
- Wann zuletzt genutzt?
- Gibt es leichtere Alternativen?
- Kann die Funktion ins Theme?
- Ist es wirklich notwendig?
# 3. Performance-Killer identifizieren
## Häufige Probleme:
- Social Media Plugins (besser: Statische Links)
- Live Chat (besser: Self-hosted)
- Page Builder (besser: Gutenberg/FSE)
- Related Posts (besser: Manuelle Verlinkung)
- Statistik Plugins (besser: Server-Logs)
# 4. Plugin-Optimierung
## Contact Form 7
- CAPTCHA durch Honeypot ersetzen
- JavaScript/CSS nur auf Kontaktseiten laden
## WooCommerce
- Template Debug aktivieren
- Heartbeat API optimieren
- Cart Fragments deaktivieren
- Sessions nur für Käufer
## Yoast SEO
- XML Sitemaps über Nginx
- Keine Kommentare-Metabox
- Keine Admin-Columns
# 5. Monitoring einrichten
## New Relic APM konfigurieren:
php_value newrelic.appname = "WordPress-Production"
php_value newrelic.framework = "wordpress"
## Debug.log aktivieren (NUR in Staging/Dev!):
# ⚠️ NIEMALS in Production aktiviert lassen!
# wp-config.php (nur temporär):
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
## Debug.log analysieren:
# Log-Datei: /wp-content/debug.log
tail -f /wp-content/debug.log | grep "plugin|theme|query"
# Nach Plugin-Performance suchen:
grep -i "slow|timeout|memory" /wp-content/debug.log
# Log rotieren (wird schnell groß!):
logrotate -f /etc/logrotate.d/wordpress-debug
## Production Monitoring (stattdessen):
# Query Monitor Plugin (nur für Admins)
# New Relic Browser Monitoring
# Server-Level Monitoring (Grafana/Prometheus)Theme-Performance & Core Web Vitals
Ein optimiertes Theme ist der Grundstein für gute Core Web Vitals. Bei meinem letzten Projekt konnte ich den LCP von 4.2s auf 1.8s reduzieren - nur durch Theme-Optimierung. Hier ist wie du das auch schaffst:
# 1. Theme Performance Audit
## Chrome DevTools Audit durchführen:
- Coverage Tab öffnen
- Unused CSS/JS identifizieren
- Render-Blocking Resources finden
# 2. CSS Optimierung
## Critical CSS generieren:
- Above-the-fold CSS identifizieren
- Inline Critical CSS
- Rest async laden
## Unnötiges CSS entfernen:
- Framework-Bloat reduzieren
- Ungenutztes CSS eliminieren
- CSS Bundles optimieren
# 3. JavaScript Performance
## JS defer/async optimieren:
add_filter('script_loader_tag', function($tag, $handle) {
if (!is_admin()) {
return str_replace(' src', ' defer src', $tag);
}
return $tag;
}, 10, 2);
## JavaScript Execution optimieren:
- requestAnimationFrame nutzen
- Event Delegation implementieren
- Debounce/Throttle für Events
# 4. Bilder & Fonts
## Automatische Bildoptimierung:
add_image_size('hero-mobile', 640, 400, true);
add_image_size('hero-tablet', 1024, 640, true);
add_image_size('hero-desktop', 1920, 1200, true);
## Font Loading optimieren:
- font-display: swap
- Subset Fonts
- WOFF2 Format
- Preload kritische Fonts
# 5. Template Performance
## Template-Parts cachen:
$cache_key = 'header_' . get_locale();
$output = wp_cache_get($cache_key);
if (false === $output) {
ob_start();
get_template_part('template-parts/header');
$output = ob_get_clean();
wp_cache_set($cache_key, $output, '', 3600);
}
echo $output;6. Server & Hosting Optimierung
🎯 Hosting-Realität: 80% nutzen Shared Hosting
Die meisten WordPress-Nutzer haben KEINEN Root-Zugriff auf ihren Server. Deshalb zeige ich dir zuerst, was du bei Shared Hosting machen kannst, und dann die VPS/Dedicated-Optimierungen für Fortgeschrittene.
Shared Hosting: Was du trotzdem optimieren kannst
Bei Shared Hosting (Strato, 1&1, All-Inkl, etc.) hast du begrenzte Möglichkeiten, aber einige wichtige Optimierungen sind trotzdem möglich:
# 1. .htaccess Optimierungen (funktioniert bei den meisten Hostern)
## Browser Caching aktivieren:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
</IfModule>
## Gzip Kompression:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
## Security Headers:
<IfModule mod_headers.c>
Header always set X-Content-Type-Options nosniff
Header always set X-Frame-Options DENY
Header always set X-XSS-Protection "1; mode=block"
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
</IfModule>
# 2. PHP.ini Anpassungen (oft über cPanel/Plesk möglich)
## In cPanel -> PHP Selector oder MultiPHP INI Editor:
memory_limit = 256M # Oft Standard: 128M
max_execution_time = 60 # Shared Hosting: meist 30s
post_max_size = 32M # Für größere Uploads
upload_max_filesize = 32M # Für Bilder/Videos
max_input_vars = 3000 # Für Page Builder
# 3. wp-config.php Optimierungen
## Automatische Updates deaktivieren (Performance):
define('AUTOMATIC_UPDATER_DISABLED', true);
define('WP_AUTO_UPDATE_CORE', false);
## Revisionen begrenzen:
define('WP_POST_REVISIONS', 3);
## Autosave-Intervall erhöhen:
define('AUTOSAVE_INTERVAL', 300); // 5 Minuten statt 60 Sekunden
## Trash-Aufbewahrung reduzieren:
define('EMPTY_TRASH_DAYS', 7); // Standard: 30 Tage
# 4. Shared Hosting Provider Vergleich (Performance-Fokus)
## ✅ Empfehlenswerte Shared Hoster:
- All-Inkl.com: SSD, HTTP/2, PHP 8.3, kostenlose SSL
- Webgo.de: NVMe SSD, LiteSpeed, Object Cache
- Netcup.de: SSD, nginx, günstig, guter Support
- Hetzner: Shared Hosting mit SSD, sehr schnell
## ❌ Performance-Probleme oft bei:
- 1&1 IONOS: Langsame Datenbanken, überlastete Server
- Strato: Alte Hardware, langsame PHP-Versionen
- GoDaddy: Überlastete Server, schlechte TTFB
- HostEurope: Veraltete Technologie
# 5. Shared Hosting Limits prüfen
## Wichtige Limits checken:
- CPU-Zeit pro Request (meist 30-60s)
- Memory Limit (128-512MB)
- Inodes (Dateien-Anzahl): 250.000-1.000.000
- MySQL Queries pro Stunde: 50.000-100.000
- Bandwidth: 10-100GB/Monat
## Limits testen:
# wp-cli (falls verfügbar):
wp eval "echo 'Memory: ' . ini_get('memory_limit') . PHP_EOL;"
wp eval "echo 'Max Execution: ' . ini_get('max_execution_time') . PHP_EOL;"
# Oder PHP-Info Seite erstellen:
<?php phpinfo(); ?>VPS/Dedicated Server: Vollkontrolle für Profis
Mit Root-Zugriff kannst du die volle Server-Performance ausschöpfen. Hier sind die wichtigsten Optimierungen für VPS und Dedicated Server:
# 1. NGINX + PHP-FPM Stack (empfohlen für WordPress)
## NGINX Installation & Konfiguration:
apt update && apt install nginx php8.3-fpm mariadb-server
## NGINX WordPress-Konfiguration:
server {
listen 80;
server_name example.com;
root /var/www/html;
index index.php index.html;
# FastCGI Cache
set $skip_cache 0;
if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php") {
set $skip_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_logged_in") {
set $skip_cache 1;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 60m;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
# Static files caching
location ~* \.(jpg|jpeg|gif|png|webp|svg|css|js|ico|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
# 2. PHP 8.3 Optimierung
## php.ini für WordPress:
memory_limit = 512M # Für größere Sites
max_execution_time = 300
post_max_size = 64M
upload_max_filesize = 64M
max_input_vars = 5000
## OPcache (kritisch für Performance!):
opcache.enable = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 10000
opcache.revalidate_freq = 2
opcache.fast_shutdown = 1
## PHP-FPM Pool (/etc/php/8.3/fpm/pool.d/www.conf):
pm = dynamic
pm.max_children = 50 # RAM abhängig
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 20
pm.max_requests = 500
# 3. MariaDB 10.11 Tuning
## /etc/mysql/mariadb.conf.d/50-server.cnf:
[mysqld]
innodb_buffer_pool_size = 1G # 70% vom verfügbaren RAM
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_buffer_pool_instances = 8
# Query Cache für MariaDB < 10.10
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 2M
# Slow Query Log
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
# 4. Redis Object Cache
## Installation:
apt install redis-server php-redis
## Redis Konfiguration (/etc/redis/redis.conf):
bind 127.0.0.1
requirepass your-secure-password
maxmemory 256mb
maxmemory-policy allkeys-lru
save "" # Keine Persistierung für Cache
## WordPress Integration:
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PASSWORD', 'your-secure-password');
define('WP_REDIS_DATABASE', 0);
# 5. System-Level Optimierungen
## Swap reduzieren:
echo 'vm.swappiness=10' >> /etc/sysctl.conf
## File Descriptor Limits erhöhen:
echo '* soft nofile 65536' >> /etc/security/limits.conf
echo '* hard nofile 65536' >> /etc/security/limits.conf
## TCP Optimierungen:
echo 'net.core.somaxconn = 65536' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_max_syn_backlog = 65536' >> /etc/sysctl.conf
# 6. Monitoring Setup
## htop für Prozess-Monitoring:
apt install htop iotop nethogs
## MySQL Performance Schema:
SET GLOBAL performance_schema = ON;
## NGINX Status Page:
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}Hosting-Provider Empfehlungen 2025
Basierend auf echten Performance-Tests und Client-Erfahrungen - hier sind meine aktuellen Empfehlungen für verschiedene Budgets:
💰 Budget Shared Hosting (5-15€/Monat)
- All-Inkl.com: Beste Performance/Preis, SSD, HTTP/2
- Netcup Webhosting: NVMe SSD, nginx, sehr günstig
- Webgo.de: LiteSpeed, Object Cache, guter Support
- Hetzner Shared: Schnell, zuverlässig, faire Preise
🚀 Managed WordPress (15-50€/Monat)
- Raidboxes: Deutsche Qualität, automatische Updates
- WP Engine: Globaler Leader, beste Performance
- Kinsta: Google Cloud, Premium-Features
- Cloudways: Flexibel, verschiedene Cloud-Provider
⚡ VPS/Cloud (10-100€/Monat)
- Hetzner Cloud: Beste Preis/Leistung, deutsche Rechenzentren
- DigitalOcean: Einfach, zuverlässig, gute Dokumentation
- Linode: Stabile Performance, faire Preise
- Vultr: Viele Standorte, gute Performance
🏢 Enterprise (100€+/Monat)
- AWS/Google Cloud: Maximale Skalierbarkeit
- WP Engine Enterprise: Premium WordPress-Hosting
- Pantheon: DevOps-Tools, Git-Workflows
- Platform.sh: Container-basiert, sehr flexibel
Performance-Benchmarks: Hosting im Vergleich
| Hosting-Typ | TTFB | LCP | Kosten/Monat | Für wen? |
|---|---|---|---|---|
| Shared Hosting (schlecht) | 800-2000ms | 3-8s | 3-8€ | Hobby-Projekte |
| Shared Hosting (gut) | 200-500ms | 1.5-3s | 8-20€ | Kleine Businesses |
| Managed WordPress | 100-300ms | 1-2s | 20-80€ | Professionelle Sites |
| VPS (optimiert) | 80-200ms | 0.8-1.5s | 15-50€ | Tech-Profis |
| Enterprise Cloud | 50-120ms | 0.5-1s | 100€+ | High-Traffic Sites |
7. Monitoring & kontinuierliche Wartung
⚠️ Performance verschlechtert sich schleichend!
Ohne kontinuierliches Monitoring merkst du nicht, wenn deine WordPress-Performance langsam schlechter wird. Plugin-Updates, neue Inhalte, mehr Traffic - alles kann die Performance beeinträchtigen. Deshalb brauchst du automatisiertes Monitoring!
Automatisiertes Performance-Monitoring
Du kannst nicht jeden Tag manuell PageSpeed Insights checken. Hier sind die Tools und Setups, mit denen ich bei Clients automatisch Performance-Probleme erkenne, bevor sie sich auf Rankings und Conversions auswirken:
# 1. Google PageSpeed Insights API (kostenlos, 25.000 Requests/Tag)
## API Key holen: https://developers.google.com/speed/docs/insights/v5/get-started
## Täglicher Automated Test:
#!/bin/bash
API_KEY="your-api-key"
URL="https://yoursite.com"
WEBHOOK_URL="https://discord.com/api/webhooks/your-webhook"
# Desktop Test
DESKTOP=$(curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=$URL&key=$API_KEY&category=performance&strategy=desktop")
DESKTOP_SCORE=$(echo $DESKTOP | jq '.lighthouseResult.categories.performance.score * 100')
# Mobile Test
MOBILE=$(curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=$URL&key=$API_KEY&category=performance&strategy=mobile")
MOBILE_SCORE=$(echo $MOBILE | jq '.lighthouseResult.categories.performance.score * 100')
# Core Web Vitals extrahieren
LCP=$(echo $MOBILE | jq '.lighthouseResult.audits."largest-contentful-paint".displayValue' | tr -d '"')
FID=$(echo $MOBILE | jq '.lighthouseResult.audits."max-potential-fid".displayValue' | tr -d '"')
CLS=$(echo $MOBILE | jq '.lighthouseResult.audits."cumulative-layout-shift".displayValue' | tr -d '"')
# Alert bei schlechter Performance
if (( $(echo "$MOBILE_SCORE < 75" | bc -l) )); then
curl -X POST $WEBHOOK_URL \
-H "Content-Type: application/json" \
-d "{"content": "🚨 Performance Alert: $URL\nMobile Score: $MOBILE_SCORE\nLCP: $LCP, CLS: $CLS"}"
fi
# Crontab für tägliche Tests um 6:00 Uhr:
# 0 6 * * * /path/to/performance-check.sh
# 2. WordPress Performance Logging
## functions.php - Custom Performance Tracking:
function track_page_load_time() {
if (!is_admin() && !wp_doing_ajax()) {
$start_time = $_SERVER['REQUEST_TIME_FLOAT'];
$end_time = microtime(true);
$load_time = round(($end_time - $start_time) * 1000, 2);
// Log langsame Seiten (>2s)
if ($load_time > 2000) {
error_log("Slow page: " . $_SERVER['REQUEST_URI'] . " - " . $load_time . "ms");
}
// Optional: An externe API senden
if ($load_time > 3000) {
wp_remote_post('https://your-monitoring-api.com/alert', [
'body' => json_encode([
'url' => home_url($_SERVER['REQUEST_URI']),
'load_time' => $load_time,
'timestamp' => time()
])
]);
}
}
}
add_action('wp_footer', 'track_page_load_time');
# 3. Database Performance Monitoring
## Slow Query Log analysieren (täglich per Cron):
#!/bin/bash
SLOW_LOG="/var/log/mysql/slow.log"
# Slow Queries der letzten 24h analysieren
mysqldumpslow -s t -t 10 $SLOW_LOG | grep -A 20 "Count:"
# Alert bei >50 slow queries/Tag
SLOW_COUNT=$(grep -c "Query_time" $SLOW_LOG)
if [ $SLOW_COUNT -gt 50 ]; then
echo "Warning: $SLOW_COUNT slow queries yesterday" | mail -s "MySQL Performance Alert" admin@yoursite.com
fiWartungsplan: Was wann machen?
WordPress Performance ist kein "einmal machen und fertig" - es braucht regelmäßige Wartung. Hier ist mein bewährter Wartungsplan für professionelle WordPress-Sites:
📅 Täglich (automatisiert)
- • Performance-Tests: PageSpeed Insights API
- • Uptime-Monitoring: UptimeRobot/Pingdom
- • Error-Log Check: PHP/WordPress Errors
- • Backup-Verification: Backup erfolgreich?
- • Security-Scan: Malware/Intrusion Detection
📅 Wöchentlich (manuell)
- • Plugin-Updates: Staging → Production
- • Performance-Report: Trends analysieren
- • Cache-Analyse: Hit-Rates prüfen
- • CDN-Statistiken: Bandwidth & Requests
- • Core Web Vitals: Google Search Console
📅 Monatlich (gründlich)
- • Database-Cleanup: Revisionen, Spam, Transients
- • Image-Audit: Unoptimierte Bilder finden
- • Plugin-Audit: Unnötige Plugins entfernen
- • Server-Resources: RAM/CPU/Storage prüfen
- • Performance-Benchmark: Konkurrenz vergleichen
📅 Quartalsweise (strategisch)
- • Hosting-Review: Provider-Performance bewerten
- • Tech-Stack Update: PHP/MySQL/WordPress Major
- • Security-Audit: Penetration Testing
- • Performance-ROI: Business-Impact messen
- • Disaster-Recovery: Backup-Restore testen
WordPress Performance-Checkliste 2025
# WordPress Performance Checkliste 2025 ## ✅ = Implementiert | ❌ = Noch zu tun | ⚠️ = Teilweise ### 1. Grundlagen ☐ WordPress 6.4+ mit PHP 8.2/8.3 ☐ Qualitäts-Hosting (SSD, HTTP/2, Gzip) ☐ SSL-Zertifikat aktiv ☐ CDN konfiguriert (Cloudflare/KeyCDN) ### 2. Caching ☐ Page Cache (WP Rocket/LiteSpeed/W3TC) ☐ Object Cache (Redis/Memcached) ☐ Browser Caching (.htaccess/NGINX) ☐ CDN Cache konfiguriert ### 3. Bilder & Media ☐ Bilder komprimiert (WebP/AVIF) ☐ Lazy Loading aktiviert ☐ Responsive Images (srcset) ☐ Unnötige Bildgrößen entfernt ### 4. Code-Optimierung ☐ CSS minifiziert und kombiniert ☐ JavaScript optimiert (defer/async) ☐ Critical CSS generiert ☐ Unused CSS/JS entfernt ### 5. Database ☐ Revisionen begrenzt (max. 3) ☐ Spam/Trash regelmäßig geleert ☐ Transients aufgeräumt ☐ Database-Indizes optimiert ### 6. Plugins & Themes ☐ Plugin-Audit durchgeführt ☐ Nur notwendige Plugins aktiv ☐ Lightweight Theme gewählt ☐ Page Builder vermieden/optimiert ### 7. Monitoring ☐ Performance-Monitoring aktiv ☐ Uptime-Monitoring konfiguriert ☐ Error-Logging aktiviert ☐ Core Web Vitals überwacht ### 8. Security & Wartung ☐ Automatische Backups ☐ Security-Plugin aktiv ☐ Updates regelmäßig eingespielt ☐ Staging-Umgebung vorhanden ### 9. Core Web Vitals Targets ☐ LCP < 2.5s (Largest Contentful Paint) ☐ FID < 100ms (First Input Delay) ☐ CLS < 0.1 (Cumulative Layout Shift) ☐ TTFB < 600ms (Time to First Byte) ### 10. Business Metrics ☐ PageSpeed Score > 85 ☐ GTmetrix Grade A/B ☐ Bounce Rate < 40% ☐ Conversion-Tracking aktiv
🎯 Fazit: WordPress Performance ist ein Marathon, kein Sprint
WordPress Performance-Optimierung ist kein einmaliges Projekt, sondern ein kontinuierlicher Prozess. Mit den richtigen Tools, Monitoring und Wartungsroutinen behältst du dauerhaft schnelle Ladezeiten und exzellente Core Web Vitals - was sich direkt in besseren Rankings und höheren Conversions niederschlägt.
📊 Performance-ROI Case Study: WooCommerce Client (Langzeit-Update)
Ausgangslage: 8,4s Ladezeit, LCP bei 6,2s, Position 8-12
Nach 2-tägiger Optimierung: 1,2s Ladezeit, LCP bei 1,8s
📊 Technische Verbesserungen:
• Ladezeit: 8,4s → 1,2s (-86%)
• LCP: 6,2s → 1,8s (-71%)
• DB Queries: 89 → 23 (-74%)
• Page Size: 4,7MB → 850KB (-82%)
• PageSpeed Score: 23 → 95 (+313%)
📈 Business Impact (nach 6 Monaten):
• Conversion-Rate: +23% (von 2,1% auf 2,6%)
• Organischer Traffic: +35% (bessere Core Web Vitals)
• Google Rankings: +3-5 Positionen (durchschnittlich)
• Bounce Rate: -18% (von 67% auf 55%)
• Mobile Conversions: +41% (LCP-Verbesserung)
💰 ROI-Berechnung:
Optimierung: 1.800€ | Zusatzumsatz/Jahr: 28.000€ | ROI: 1.456%