Back to Shared Hosting Docs

    WordPress Optimization

    Speed up your WordPress site for better performance

    Why Optimize WordPress?

    A fast website improves user experience, SEO rankings, and conversion rates. WordPress can become slow with poor configuration, too many plugins, or unoptimized content.

    Choose a Lightweight Theme

    • Avoid bloated themes: Heavy multipurpose themes slow sites down
    • Good options: GeneratePress, Astra, Kadence
    • Test theme speed: Check demo site performance first
    • Avoid excessive features: Page builders add overhead

    Essential WordPress Plugins

    Caching Plugin (Required)

    WP Super Cache or W3 Total Cache:

    • Creates static HTML files
    • Reduces database queries
    • Dramatically improves speed
    • Easy to configure

    Image Optimization

    ShortPixel or Smush:

    • Compress images without quality loss
    • Reduce file sizes by 50-80%
    • Lazy loading images
    • Convert to modern formats (WebP)

    Database Optimization

    WP-Optimize:

    • Clean database tables
    • Remove post revisions
    • Delete spam comments
    • Optimize database structure

    Plugin Management Tips

    • Minimize plugins: Each adds overhead
    • Delete unused plugins: Deactivating isn't enough
    • Quality over quantity: Well-coded plugins matter
    • Combine functionality: One plugin doing multiple jobs
    • Audit regularly: Review plugins quarterly

    Image Optimization Tips

    • Resize before upload: Don't upload 4000px images
    • Use correct format: JPG for photos, PNG for graphics
    • Compress images: Tools like TinyPNG before upload
    • Lazy loading: Load images only when visible
    • WebP format: Modern format with better compression
    • Responsive images: Serve appropriate sizes

    Content Delivery Network (CDN)

    CDN serves static files from servers closer to visitors:

    Popular CDNs

    • Cloudflare: Free tier available
    • BunnyCDN: Affordable, fast
    • StackPath: Good WordPress integration

    CDN Benefits

    • Faster global loading
    • Reduced server load
    • Better for international visitors
    • DDoS protection

    Database Optimization

    Limit Post Revisions

    Add to wp-config.php:

    define( 'WP_POST_REVISIONS', 3 );

    Increase Autosave Interval

    define( 'AUTOSAVE_INTERVAL', 300 ); // 5 minutes

    Empty Trash Automatically

    define( 'EMPTY_TRASH_DAYS', 7 ); // Delete after 7 days

    Caching Configuration

    Page Caching

    • Enable full-page caching
    • Cache expiration: 1-24 hours
    • Exclude admin, cart, checkout

    Browser Caching

    • Set long expiry for static assets
    • Typically 1 year for images, CSS, JS

    Object Caching

    • Memcached or Redis if available
    • Reduces database queries

    Testing Your Site Speed

    Testing Tools

    • GTmetrix: Detailed performance report
    • Google PageSpeed Insights: Google's perspective
    • Pingdom: Test from multiple locations
    • WebPageTest: Advanced testing options

    Key Metrics

    • Load Time: Under 3 seconds ideal
    • Time to First Byte: Server response time
    • Largest Contentful Paint: Main content loads
    • Total Page Size: Under 3MB recommended

    Quick Wins Checklist

    1. ✓ Install caching plugin
    2. ✓ Optimize all images
    3. ✓ Enable compression
    4. ✓ Use latest PHP version
    5. ✓ Minimize plugins
    6. ✓ Choose lightweight theme
    7. ✓ Enable lazy loading
    8. ✓ Clean up database
    9. ✓ Disable pingbacks
    10. ✓ Test site speed

    Common Mistakes to Avoid

    • Too many plugins: 20+ plugins is usually too many
    • Not using caching: Caching is essential
    • Huge images: Optimize before uploading
    • Cheap themes: Poorly coded themes hurt performance
    • Shared hosting limits: Know your resource limits
    • No monitoring: Track performance over time