domingo, 30 Ago 2026

Exclusive resources and tools for web design and development experts

Explore
BiblioWeb

Biblioweb.es

All About Web Technology

  • Start
  • Categories
    • Web Development and Plugins
    • AI & Web Automation
    • Cybersecurity and Web Security
    • WordPress Plugins
    • Web error solution
    • Web Hosting & Performance
  • WordPress
    • All about WordPress
    • WordPress Plugins
    • Web Development and Plugins
    • AI and Web Automation
    • WooCommerce
    • Hosting and Web Performance
    • Cybersecurity and Web Security
    • Web Error Resolution
    • Online Stores and Funnels
  • About Plugins
    • Yoast SEO
    • WooCommerce
    • Rank Math SEO
    • AI Engine
    • WP Rocket
    • WPCode
    • WP Translate Master
    • CartBounty
    • WP SEO Pro
  • Tools
    • Password Generator
    • QR Code Generator
    • Word Counter
    • JSON Formatter
    • Compresor de Vídeo para Web
    • Generador de Firmas de Email
    • Image to WebP Converter
    • Email Checker
  • Plugins Library
  • Español
  • English ✓
  • 🇨🇳 中文(简体)
  • Français
  • Deutsch
  • Italiano
History
  • WordPress
  • WordPress plugins
  • Create website
  • WooCommerce
  • WordPress tricks
  • See everything
BiblioWebBiblioWeb
Font ResizerAa
  • News History
Search
  • Start
  • Categories
    • Web Development and Plugins
    • AI & Web Automation
    • Cybersecurity and Web Security
    • WordPress Plugins
    • WooCommerce
    • Web Hosting & Performance
    • Troubleshooting web errors
    • Online Stores & Sales Funnels
  • WordPress
    • All about WordPress
    • WordPress Plugins
    • Web Development and Plugins
    • AI and Web Automation
    • WooCommerce
    • Hosting and Web Performance
    • Cybersecurity and Web Security
    • Web Error Resolution
    • Online Stores and Funnels
  • About Plugins
    • Rank Math SEO
    • AI Engine
    • WP Rocket
    • WPCode
    • WP Translate Master
    • CartBounty
    • WP SEO Pro
  • Blog
    • Español
    • English ✓
    • 🇨🇳 中文(简体)
    • Français
    • Deutsch
    • Italiano
  • My account
    • News History
  • Tools
    • Password Generator
    • QR Code Generator
    • Word Counter
    • JSON Formatter
    • Image to WebP Converter
    • Email Checker
    • Compresor de Vídeo para Web
    • Generador de Firmas de Email
Have an existing account? Sign In
Follow Us
© 2026 BiblioWeb — All rights reserved.
Cover » Blog » How to speed up WordPress with PHP settings in 3 steps
WordPress

How to speed up WordPress with PHP settings in 3 steps

Adrián Alcalá
Last updated: 27/08/2026 10:28
By Adrián Alcalá
Share
4 Min Read
WordPress - Slow WordPress NO MORE: Discover the 'PHP Trick' Pros Use to Speed Up Their Websites in 3 Steps
Speed up your WordPress site with the professional 'PHP Trick' in 3 steps. Discover how experts optimize their websites. Improve your speed and SEO today c
SHARE

Is your site WordPress loads slowly? It's frustrating to see visitors abandon your website before the first screen finishes rendering. Speed is crucial for user experience and SEO, and although we often blame plugins or images, one of the most common bottlenecks is one level below: the server's PHP configuration. In this guide we are going to speed up WordPress with PHP settings in 3 steps: update the PHP version, adjust key directives (memory_limit, max_execution_time, upload_max_filesize) and activate OPcache. All with real code snippets and an objective way to measure the improvement.

Contents
Before touching anything: measure your starting pointStep 1: check and update your PHP versionStep 2: adjust key PHP directivesStep 3: activate OPcache, the silent turboMeasure again and compareA fondo: el límite de memoria PHP y sus errores típicosFrequently Asked Questions

Before touching anything: measure your starting point

To know if a change works, you have to measure before and after, not rely on feeling. Two free tools are enough:

  • PageSpeed Insights (pagespeed.web.dev): note the value of TTFB (time to first byte) and of LCP. TTFB is what best reflects PHP's work: it's how long the server takes to generate the page.
  • Query Monitor (free plugin): in the admin bar it shows you the page generation time in seconds and the peak memory consumed on each load.

Write down those numbers. At the end of the guide, you will repeat the measurement on the same pages and know exactly how much you have gained.

Step 1: check and update your PHP version

If you could only do one thing to speed up WordPress via PHP, this would be it. Each major PHP version is notably faster than the previous one: the jump from PHP 7.4 to PHP 8.x brought the JIT compiler and real performance improvements in WordPress, plus extra years of security support. A WordPress on PHP 8.2 or 8.3 serves more requests per second than the same site on 7.4, without changing anything else.

First, find out which version you are using. In your WordPress, go to Tools > Site Health > Info > Server: ahí verás “Versión de PHP”. Si estás por debajo de 8.1, toca actualizar.

The update is done from your hosting panel, not from WordPress:

You Might Also Like

How to choose the perfect theme to design your website in WordPress
How to use AI on WordPress to improve your SEO and content
¿Quieres saber cómo instalar WordPress como un PRO? 🚀 Guía definitiva para elegir el hosting perfecto (¡y que tu web vuele!)
Cómo instalar WordPress rápido: guía definitiva paso a paso
  1. Make a full backup (files and database). It's a reversible change, but better with a safety net.
  2. Log in to your hosting panel. In cPanel busca “Select PHP Version” o “MultiPHP Manager”; en Plesk, “Configuración de PHP” dentro del dominio; en IONOS, SiteGround o Webempresa hay un selector equivalente en los ajustes del sitio.
  3. Select the latest stable version supported by your hosting (ideally PHP 8.2 or 8.3) and save.
  4. Browse your website and WordPress dashboard for a few minutes. If a fatal error appears, it's almost always an incompatible old plugin or theme: revert to the previous PHP version from the same selector, update or replace the conflicting component, and retry.

What improves: the entire server processing time. It is the adjustment with the greatest impact of the three, and it also closes vulnerabilities in unsupported versions.

Step 2: adjust key PHP directives

PHP works with configurable limits. If they are too low, WordPress drags or directly fails; if they are well-sized, the site breathes. The three directives that matter:

  • memory_limit: maximum memory per PHP process. With visual themes, WooCommerce, or many plugins, 128M is insufficient; 256M is the recommended value today.
  • max_execution_time: seconds a script can run before being cut off. Affects imports, backups, and large updates. 60-120 seconds is reasonable.
  • upload_max_filesize (and its partner post_max_size): maximum upload size. If you can't upload a theme or a video, this is it.

You can set them in three places, depending on the access your hosting gives you. Choose only one, not all three at once.

Option A: php.ini (the preferred method)

Many shared hostings let you edit a php.ini from the panel itself (or the PHP selector brings these options as editable fields). The values would be as follows:

memory_limit = 256M
max_execution_time = 120
upload_max_filesize = 64M
post_max_size = 64M

Option B: wp-config.php (for WordPress memory)

WordPress defines its own memory limits above PHP. Edit wp-config.php via FTP or from the file manager and add these lines just before /* That's all, stop editing! Happy publishing. */:

define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

La primera fija la memoria del sitio público; la segunda, la del escritorio de administración, que suele necesitar más. Más abajo dedicamos un apartado completo al límite de memoria, con los errores típicos y sus soluciones.

Option C: .htaccess (Apache with mod_php only)

If your server is Apache and runs PHP as a module, you can add to the end of the .htaccess from the root:

php_value memory_limit 256M
php_value max_execution_time 120
php_value upload_max_filesize 64M
php_value post_max_size 64M

Warning: on servers with PHP-FPM (most modern hostings) these lines cause a 500 error. If your website crashes when saving them, delete them and use option A or B.

What improves: elimina errores de memoria agotada, timeouts en actualizaciones e importaciones, y fallos al subir archivos grandes. No hace la web “más rápida” en cada visita, pero sí más estable bajo carga.

Step 3: activate OPcache, the silent turbo

Every time someone visits your website, PHP would have to read and compile dozens of WordPress files. OPcache saves that already compiled code in memory, so that subsequent requests are served without recompiling anything. It's the cheapest performance improvement available: it's included in PHP and just needs to be activated.

Check if you have it in Tools > Site Health > Info > Server (o pregunta a tu hosting). En la mayoría de paneles se activa con una casilla en el selector de PHP (“opcache”). Si tu hosting te permite ajustar su configuración, estos valores funcionan bien para WordPress:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60

What improves: the processing time of each PHP request, across the entire site. Along with the updated PHP version, it's what lowers the TTFB the most.

OPcache speeds up PHP execution, but it doesn't prevent it from running on every visit: page caching does that. They are complementary layers, and we tell you about the second one in our analysis of WP Rocket, the reference cache plugin in WordPress.

Measure again and compare

Now repeat the initial measurements, on the same pages: PageSpeed Insights for TTFB and LCP, and Query Monitor for generation time and memory. Speeding up WordPress with PHP settings is not magic, it's server physics: what's common after these three steps is to see the TTFB drop significantly (often 20-40% just with the PHP version jump and OPcache) and memory and timeout errors disappear. If your website is still slow after this, the problem will be in another layer: heavy plugins, unoptimized images, or an undersized server. In that case, check what hosting you need for WordPress before continuing to accumulate optimization plugins.

A fondo: el límite de memoria PHP y sus errores típicos

De las tres directivas anteriores, memory_limit es la que más problemas da en el día a día, así que merece su propio apartado. WordPress está escrito en PHP, y cada vez que alguien carga una página, el servidor ejecuta un proceso PHP que consume memoria RAM. El límite de memoria define cuánta puede usar como máximo ese proceso: si un script lo supera, PHP lo mata en seco y la página se rompe a mitad de carga o aparece la temida pantalla blanca.

The unmistakable symptom is this message on screen or in the server error log:

Fatal error: Allowed memory size of 134217728 bytes exhausted
(tried to allocate 2348617 bytes) in /home/usuario/public_html/wp-includes/...

Ese número gigante son bytes: 134217728 equivale a 128M, que sería tu límite actual. Otras señales del mismo problema: la pantalla blanca de la muerte (WSOD) sin mensaje alguno, errores 500 intermitentes al guardar entradas o editar con el constructor, imágenes que se suben pero no generan miniaturas, y actualizaciones de plugins que se quedan a medias. WordPress también puede avisarte con un genérico “Ha habido un error crítico en esta web” mientras el detalle real queda en el log del servidor.

Identifica tu límite actual con Salud del sitio

Before changing anything, check your starting point. In your dashboard, go to Tools > Site Health > Info and open two sections:

  • WordPress (o “Constantes de WordPress”): ahí aparece el valor de WP_MEMORY_LIMIT, the limit that WordPress imposes on itself.
  • Server: ahí verás el “Límite de memoria de PHP” real del servidor (memory_limit).

Este matiz es importante: hay dos capas. WordPress usa por defecto 40M en el sitio público (64M en multisitio) aunque el servidor permita más, y el servidor a su vez tiene su propio techo. Para que un aumento funcione, el valor de WordPress debe caber dentro del valor del servidor. Los métodos para subir ambos valores son exactamente las opciones A, B y C del paso 2: php.ini para el techo del servidor y wp-config.php para el de WordPress.

When your hosting sets the limit (and what to do)

In shared hosting, the provider sets a memory_limit maximum at the server level that none of your directives can exceed: you can ask for 512M in wp-config.php, but if the plan contracts 256M, you'll stay at 256M. Clues that you are in this situation: the Site Health value does not change after editing the files, or the hosting reverts your php.ini. The real options are three: open a support ticket asking for the increase (many apply it at no cost), upgrade to a higher plan, or migrate to a provider with more generous resources. Before deciding, take a look at our guide on what hosting you need for WordPress.

Ten en cuenta también que más memoria no es un remedio universal: si un plugin tiene una fuga de memoria, subir el límite solo retrasa el error. Trata el límite de memoria como una pieza de la puesta a punto, no como la solución completa.

Frequently Asked Questions

Is it safe to update the PHP version of my WordPress?

Yes, as long as you make a full backup first. The change is reversible from the hosting panel: if something

What happens if my site doesn't work after updating PHP?

Casi siempre es un plugin o tema incompatible. Revierte la versión de PHP desde el selector del hosting para recuperar la web, activa el registro de errores o revisa el “error log” del panel para identificar el archivo que provoca el fallo, y actualiza o reemplaza ese componente. Después vuelve a subir la versión de PHP. Desactivar plugins por bloques (la mitad cada vez) también localiza al culpable rápidamente.

How much speed can I gain by accelerating WordPress with these PHP settings?

It depends on the starting point. Moving from PHP 7.4 to 8.2/8.3 with OPcache active usually reduces page generation time by 20 to 40%, which is especially noticeable in TTFB and the administration dashboard. Memory and execution time settings don't speed up every visit, but they eliminate errors and crashes during peak workloads. To further reduce loading time, the next step is full page caching.

What is a recommended PHP memory limit for WordPress?

For a simple blog or corporate website, 128M is enough. For most sites with a visual builder and a dozen plugins, 256M is the sweet spot. WooCommerce stores with large catalogs, or websites with frequent imports, may need 512M. Going beyond that rarely helps: if you're still running out of memory with 512M, the problem is usually a faulty plugin, not the limit.

What happens if my hosting doesn't allow me to increase the PHP memory limit?

First, contact support: in many hostings, increasing it to 256M is a matter of asking. If your contracted plan has a hard cap, consider upgrading your plan or migrating to a provider with more resources, especially if your website generates income. Meanwhile, reduce consumption: deactivate unused plugins, avoid heavy builders, and keep your theme updated.

TAGGED:AcelerarDiscoverLentotrucoUsanWordPress
Share This Article
Email Copy Link Print
ByAdrián Alcalá
Follow:
Adrián Alcalá es desarrollador WordPress y consultor SEO, autor del plugin WP Translate y creador de BiblioWeb. Desde aquí comparte guías, tutoriales y herramientas gratuitas para quienes crean, optimizan y posicionan páginas web. Lleva años ayudando a negocios de toda España a sacar el máximo partido a WordPress, y todo lo que publica está probado en proyectos reales.
Previous Article WordPress - Beginner's Error: The 5 Mistakes When Installing WordPress That Destroy Your Website Common errors when installing WordPress and how to avoid them
Next Article WordPress - Sell MORE with AI. Payment Gateways for your WooCommerce that Skyrocket your Sales (and how to configure them for Payment gateways for WooCommerce: which ones to use and how to configure them
como instalar wordpress - ¡Tu primera web en marcha! 🎉 Cómo instalar WordPress sin estrés y con la confianza de un experto (
¡Tu primera web en marcha! 🎉 Cómo instalar WordPress sin estrés y con la confianza de un experto (¡Te lo ponemos fácil!).
WordPress
Best resources to learn WordPress
Los mejores recursos para aprender WordPress en español
WordPress
como instalar wordpress - ¡Adiós al miedo! Cómo instalar WordPress en tu propio servidor local (¡Perfecto para experimentar s
¡Adiós al miedo! Cómo instalar WordPress en tu propio servidor local (¡Perfecto para experimentar sin riesgos y crear tu #CrearPaginaWeb!)
WordPress
Why WordPress is free
¿Por qué WordPress es gratis? Así se financia el proyecto
WordPress
Advertisement

You May Also Like

Update WordPress safely
WordPress

Cómo actualizar WordPress de forma segura (núcleo, tema y sin sustos)

24/08/2026
Web Automation: n8n — illustration about Web Automation: n8n or Zapier? The Strategic Choice for Your WordPress Agency
WordPress

Web Automation: n8n or Zapier? The strategic choice for your WordPress agency

24/08/2026
Gutenberg block editor guide
WordPress

WordPress Block Editor Guide (Gutenberg)

08/08/2026
WordPress - Goodbye to doubts Connect Google Analytics 4 to your WordPress and start growing (Guide to create a website for
WordPress

How to connect Google Analytics 4 to WordPress step by step

08/08/2026
Show More
  • More News:
  • WordPress
  • Install
  • Guide
  • Create Web Page
  • how to install WordPress
  • Create
  • installation
  • future
  • Discover
  • Yoast
  • Plugins
  • tricks
  • WordPress installation
  • Goodbye
  • Runways
  • page
  • Create webpage
  • truco
  • Error
  • Construcción
BiblioWeb

Biblioweb.es

Web Technology News

Information you can trust: guías y soluciones prácticas de tecnología web — WordPress, plugins, ciberseguridad, hosting, rendimiento y solución de errores.

RSS

Enlaces de interés

  • About us
  • Contact
  • Free tools
  • Plugin Library

Subscribe now to receive real-time updates on the latest news!

Legal

  • Legal Notice
  • Terms and Conditions
  • Cookies Policy
  • Privacy Policy

Latest news

como instalar wordpress - ¡Tu primera web en marcha! 🎉 Cómo instalar WordPress sin estrés y con la confianza de un experto (

¡Tu primera web en marcha! 🎉 Cómo instalar WordPress sin estrés y con la confianza de un experto (¡Te lo ponemos fácil!).

25/08/2026
Continue reading
como instalar wordpress - ¿Quieres saber cómo instalar WordPress como un PRO? 🚀 Guía definitiva para elegir el hosting perfe

¿Quieres saber cómo instalar WordPress como un PRO? 🚀 Guía definitiva para elegir el hosting perfecto (¡y que tu web vuele!)

24/08/2026
Continue reading

© 2026 BiblioWeb — All rights reserved.

Gestionar consentimiento
Utilizamos tecnologías como las cookies para almacenar y/o acceder a la información del dispositivo. Lo hacemos para mejorar la experiencia de navegación y para mostrar anuncios (no) personalizados. El consentimiento a estas tecnologías nos permitirá procesar datos como el comportamiento de navegación o los ID's únicos en este sitio. No consentir o retirar el consentimiento, puede afectar negativamente a ciertas características y funciones.
Funcional Always active
El almacenamiento o acceso técnico es estrictamente necesario para el propósito legítimo de permitir el uso de un servicio específico explícitamente solicitado por el abonado o usuario, o con el único propósito de llevar a cabo la transmisión de una comunicación a través de una red de comunicaciones electrónicas.
Preferences
El almacenamiento o acceso técnico es necesario para la finalidad legítima de almacenar preferencias no solicitadas por el abonado o usuario.
Estadísticas
El almacenamiento o acceso técnico que es utilizado exclusivamente con fines estadísticos. El almacenamiento o acceso técnico que se utiliza exclusivamente con fines estadísticos anónimos. Sin un requerimiento, el cumplimiento voluntario por parte de tu proveedor de servicios de Internet, o los registros adicionales de un tercero, la información almacenada o recuperada sólo para este propósito no se puede utilizar para identificarte.
Marketing
El almacenamiento o acceso técnico es necesario para crear perfiles de usuario para enviar publicidad, o para rastrear al usuario en una web o en varias web con fines de marketing similares.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferencias
  • {title}
  • {title}
  • {title}
Welcome to Foxiz
Username or Email Address
Password

Lost your password?