{"id":4696,"date":"2018-04-13T12:14:29","date_gmt":"2018-04-13T06:44:29","guid":{"rendered":"https:\/\/phpyouth.com\/blog\/?p=4696"},"modified":"2025-10-14T12:04:30","modified_gmt":"2025-10-14T06:34:30","slug":"increase-wordpress-memory-limit-using-htaccess","status":"publish","type":"post","link":"https:\/\/phpyouth.com\/blog\/increase-wordpress-memory-limit-using-htaccess\/","title":{"rendered":"Increase WordPress Memory Limit using .htaccess"},"content":{"rendered":"<p>If you don&#8217;t have access to the php.ini file, don&#8217;t worry! You can easily increase the PHP memory limit via the .htaccess file. Just copy and paste the following code into your .htaccess file to increase the memory limit.<\/p>\n<p>To increase the memory limit, simply add the following line to your .htaccess file, which is usually located in the root directory of your website:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">php_value memory_limit 256M<\/pre>\n<p>If you already have this code and nothing will change then try&#8230;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">php_value memory_limit 512M<\/pre>\n<p>Adding this snippet will help your WordPress site handle more memory-intensive processes, improving performance and avoiding memory exhaustion errors.<\/p>\n<p><a href=\"https:\/\/www.hostg.xyz\/aff_c?offer_id=6&#038;aff_id=115521&#038;url_id=35&#038;file_id=1399\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/media.go2speed.org\/brand\/files\/hostinger\/6\/EN-970x250.jpg?resize=970%2C250&#038;ssl=1\" width=\"970\" height=\"250\" border=\"0\" alt=\"\"><\/a><img decoding=\"async\" src=\"https:\/\/www.hostg.xyz\/aff_i?offer_id=6&#038;file_id=1399&#038;aff_id=115521&#038;url_id=35\" width=\"0\" height=\"0\" style=\"position:absolute;visibility:hidden;\" border=\"0\" alt=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you don&#8217;t have access to the php.ini file, don&#8217;t worry! You can easily increase the PHP memory limit via the .htaccess file. Just copy and paste the following code into your .htaccess file to increase the memory limit. To increase the memory limit, simply add the following line to your .htaccess file, which is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4697,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,4],"tags":[119,124],"class_list":["post-4696","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-php","category-wordpress","tag-htaccess","tag-wp_memory_limit","post_format-post-format-image"],"acf":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/php_value-memory_limit-512M.png?fit=560%2C315&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8zepR-1dK","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":4650,"url":"https:\/\/phpyouth.com\/blog\/how-to-resolve-this-page-isnt-working-http-error-500\/","url_meta":{"origin":4696,"position":0},"title":"How to resolve &#8220;This Page isn&#8217;t Working &#8211; HTTP ERROR 500&#8221;","author":"RK Jajoria","date":"April 13, 2018","format":false,"excerpt":"Hello, friends, today we will learn how to resolve \"This Page isn't Working HTTP ERROR 500\". Last week, we got this error while shifting one of my websites from one server to another. However, there's no need to worry, WordPress has this common error, and we can easily resolve it.\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/phpyouth.com\/blog\/category\/tutorial\/php\/"},"img":{"alt_text":"HTTP ERROR 500","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/Copy-of-fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":4690,"url":"https:\/\/phpyouth.com\/blog\/increase-wordpress-memory-limit-using-php-ini\/","url_meta":{"origin":4696,"position":1},"title":"Increase WordPress Memory Limit using php.ini","author":"RK Jajoria","date":"April 12, 2018","format":"image","excerpt":"If you want to Increase WordPress Memory Limit using php.ini, and you have access to your website\u2019s root directory, you can easily do this by editing the php.ini file. Simply add or update this line in your php.ini file to set the memory limit to 256MB: [sourcecode language=\"plain\"]memory_limit = 256M\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/phpyouth.com\/blog\/category\/tutorial\/php\/"},"img":{"alt_text":"memory_limit 256M","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/04\/fresh-aquasummit.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":4652,"url":"https:\/\/phpyouth.com\/blog\/http-to-https-redirection-automatically-using-htaccess-and-web-config\/","url_meta":{"origin":4696,"position":2},"title":"HTTP to HTTPS Redirection Automatically Using .htaccess and web.config","author":"RK Jajoria","date":"March 30, 2018","format":false,"excerpt":"Hello Friends, Today we will learn about \"How we can redirect visitors to our HTTP website to HTTPS\". If you have an SSL Secure Certificate installed on your website, you can easily redirect visitors to the secure version of your website(HTTPS) automatically. First, we have to know where your website\u2026","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/phpyouth.com\/blog\/category\/tutorial\/php\/"},"img":{"alt_text":"htaccess-http-https","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/03\/http-https-htaccess.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/03\/http-https-htaccess.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/03\/http-https-htaccess.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":4973,"url":"https:\/\/phpyouth.com\/blog\/enable-gzip-compression\/","url_meta":{"origin":4696,"position":3},"title":"How to enable GZIP compression","author":"RK Jajoria","date":"July 2, 2019","format":false,"excerpt":"Hello, friends, today\u2019s topic is how to enable GZIP compression on your web server. If you know what GZIP is and how to enable it, that\u2019s good. But if you don\u2019t, please read this tutorial till the end. What is GZIP Compression? GZIP is a file format and software application\u2026","rel":"","context":"In &quot;cPanel&quot;","block_context":{"text":"cPanel","link":"https:\/\/phpyouth.com\/blog\/category\/web-hosting\/cpanel\/"},"img":{"alt_text":"GZIP-Compression","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/GZIP-Compression.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":4827,"url":"https:\/\/phpyouth.com\/blog\/enable-http-security-headers\/","url_meta":{"origin":4696,"position":4},"title":"Enable HTTP Security Headers","author":"RK Jajoria","date":"August 13, 2018","format":false,"excerpt":"Hello, friends, today we will learn about HTTP Security Headers. There are a lot of things to consider while securing our website or web applications. HTTP Security Header is one of the best options. Implementing HTTP Security Headers is very easy on the server. HTTP Security Header provides another level\u2026","rel":"","context":"In &quot;Maintenance&quot;","block_context":{"text":"Maintenance","link":"https:\/\/phpyouth.com\/blog\/category\/wordpress\/maintenance\/"},"img":{"alt_text":"http security header","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/08\/http-security-header.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/08\/http-security-header.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2018\/08\/http-security-header.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":5000,"url":"https:\/\/phpyouth.com\/blog\/remove-wc_sessions-in-woocommerce\/","url_meta":{"origin":4696,"position":5},"title":"How to Remove wc_sessions in WooCommerce","author":"RK Jajoria","date":"July 4, 2019","format":false,"excerpt":"Hello friends! Today, in this tutorial, we will learn how to remove sessions in WooCommerce. First, we will discuss why we need to remove these sessions from WooCommerce. These sessions make the wp_options table heavy in size. WooCommerce stores the _wc_session_xxx and _wc_session_expires_xxx entries in the wp_options table. There are\u2026","rel":"","context":"In &quot;Plugins&quot;","block_context":{"text":"Plugins","link":"https:\/\/phpyouth.com\/blog\/category\/wordpress\/plugins\/"},"img":{"alt_text":"Remove woocommerce sessions","src":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/Remove-woocommerce-sessions.png?fit=560%2C315&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/Remove-woocommerce-sessions.png?fit=560%2C315&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/phpyouth.com\/blog\/wp-content\/uploads\/2019\/07\/Remove-woocommerce-sessions.png?fit=560%2C315&ssl=1&resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts\/4696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/comments?post=4696"}],"version-history":[{"count":0,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/posts\/4696\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/media\/4697"}],"wp:attachment":[{"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/media?parent=4696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/categories?post=4696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpyouth.com\/blog\/wp-json\/wp\/v2\/tags?post=4696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}