<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WPWife &#187; .htaccess</title>
	<atom:link href="http://www.wpwife.com/category/htaccess/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wpwife.com</link>
	<description>WPHelp: fix and optimise WP themes&#38;plugins</description>
	<lastBuildDate>Fri, 21 Nov 2025 12:00:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.38</generator>
	<item>
		<title>How to Fix the 500 Internal Server Error in WordPress</title>
		<link>http://www.wpwife.com/tutorials/how-to-fix-the-500-internal-server-error-in-wordpress</link>
		<comments>http://www.wpwife.com/tutorials/how-to-fix-the-500-internal-server-error-in-wordpress#comments</comments>
		<pubDate>Sat, 18 Mar 2023 14:15:00 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[common errors]]></category>
		<category><![CDATA[deactivate plugins]]></category>
		<category><![CDATA[error establishing database connection]]></category>
		<category><![CDATA[html 500 error]]></category>
		<category><![CDATA[increase memory limit]]></category>
		<category><![CDATA[internal server error]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[white screen of death]]></category>
		<category><![CDATA[wordpress white screen of death]]></category>

		<guid isPermaLink="false">http://www.wpbeginner.com/?p=10317</guid>
		<description><![CDATA[
<p>Are you seeing a 500 internal server error in WordPress? The internal server error is one of the most common WordPress errors. Since the error doesn&#8217;t give any other information, many beginners find it quite frustrating. In this article, we will show you how to&#8230;&#160;<strong><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/">Read More &#187;</a></strong></p>
<p>The post <a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/">How to Fix the 500 Internal Server Error in WordPress</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Are you seeing a 500 internal server error in WordPress? </p>



<p>The internal server error is one of the <a href="https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/" title="50 Most Common WordPress Errors and How to Fix Them">most common WordPress errors</a>. Since the error doesn&#8217;t give any other information, many beginners find it quite frustrating. </p>



<p>In this article, we will show you how to easily fix the 500 internal server error in WordPress.</p>



<figure class="wp-block-image size-full"><img width="680" height="385" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/fix-internal-server-error-og.png" alt="Fixing the internal server error in WordPress" class="wp-image-171650" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/fix-internal-server-error-og.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/fix-internal-server-error-og-300x170.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Here is a quick overview of the topics we&#8217;ll cover in this article. </p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-what-is-the-500-internal-server-error">What is The 500 Internal Server Error?</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-what-causes-the-internal-server-error-in-wordpress">What Causes The Internal Server Error in WordPress?</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-video-tutorial">Video Tutorial</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-fixing-the-500-internal-server-error-in-wordpress">Fixing The 500 Internal Server Error in WordPress</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-clear-wordpress-and-browser-cache">Clear WordPress and Browser Cache</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-checking-for-corrupt-htaccess-file">Checking for Corrupt .htaccess File</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-increasing-the-php-memory-limit">Increasing the PHP Memory Limit</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-deactivate-all-wordpress-plugins">Deactivate All WordPress Plugins</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-switch-to-a-default-wordpress-theme">Switch to a Default WordPress Theme</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-re-uploading-core-files">Re-uploading Core Files</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-enable-debug-logs-in-wordpress">Enable Debug Logs in WordPress</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/#aioseo-ask-your-hosting-provider">Ask your Hosting Provider</a></li></ul></div>



<h4 id="aioseo-what-is-the-500-internal-server-error">What is The 500 Internal Server Error? </h4>



<p>The 500 internal server error is a common web server error. It is not specific to WordPress websites and can happen with any website. </p>



<p>The 500 in the error message is technically an HTTP error code. Looking up this code will only show its standard description. </p>



<p>&#8220;<em>500 Internal Server Error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.</em>&#8220;</p>



<p>This is a generic catch-all error message which means that the server was unable to assign a better more helpful error message when it encountered the issue. </p>



<p>The error page looks different depending on which web server software (Nginx or Apache) your website is using and which browser you are using. </p>



<p>Here is how the Apache error page may look. </p>



<figure class="wp-block-image size-full"><img width="680" height="250" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/apache-internal-server-chrome.png" alt="Internal server error page on Apache " class="wp-image-171569" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/apache-internal-server-chrome.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/apache-internal-server-chrome-300x110.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>It may look different if you are using Nginx and Google Chrome. </p>



<p>It will also look different if Google chrome is unable to find an error page to display: </p>



<figure class="wp-block-image size-full"><img width="699" height="300" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/http-500-error-chrome.png" alt="Google Chrome http 500 error" class="wp-image-171570" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/http-500-error-chrome.png 699w, https://www.wpbeginner.com/wp-content/uploads/2013/01/http-500-error-chrome-300x129.png 300w" sizes="(max-width: 699px) 100vw, 699px" /></figure>



<p>For beginners, this can be incredibly frustrating. There is no clue or message that would point them in the right direction to quickly fix it. </p>



<p>Asking how to fix an internal server error is like asking your doctor how to fix the pain you&#8217;re experiencing without telling them where the pain is.</p>



<p>However, if we know the common causes that trigger this error, then we can try fixing them one by one to resolve the error without breaking anything.</p>



<h4 id="aioseo-what-causes-the-internal-server-error-in-wordpress">What Causes The Internal Server Error in WordPress? </h4>



<p>Internal server error in WordPress is often caused by a corrupt <a href="https://www.wpbeginner.com/glossary/htaccess/" title=".htaccess">.htaccess</a> file, poorly coded plugins, or your active WordPress theme. </p>



<p>Other possible causes of the internal server error in WordPress that we know of are: PHP memory limit or corrupt core WordPress files. </p>



<p>In some conditions, the internal server error may only show up when you are trying to access the <a title="What is Admin Area in WordPress" href="https://www.wpbeginner.com/glossary/admin-area/">WordPress admin area</a> while the rest of the site works fine.</p>



<p>That being said, now let&#8217;s take a look at how to go about troubleshooting the internal server error in WordPress.</p>



<h4 id="aioseo-video-tutorial">Video Tutorial</h4>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='520' height='323' src='https://www.youtube.com/embed/Qj4tfvMlcJs?version=3&#038;rel=0&%23038;fs=1&%23038;showsearch=0&%23038;showinfo=1&%23038;iv_load_policy=1&%23038;wmode=transparent' frameborder='0' allowfullscreen></iframe></span>
</div></figure>



<p>If you prefer written instructions, then continue reading.</p>



<h4 id="aioseo-fixing-the-500-internal-server-error-in-wordpress">Fixing The 500 Internal Server Error in WordPress</h4>



<p>Before you begin troubleshooting, make sure that you have a complete WordPress backup of your website on hand. </p>



<p>If you have access to the WordPress admin area, then you can a <a href="https://www.wpbeginner.com/plugins/7-best-wordpress-backup-plugins-compared-pros-and-cons/" title="7 Best WordPress Backup Plugins Compared (Pros and Cons)">WordPress backup plugin</a> to create a complete backup of your website. We recommend using <a href="https://wordpress.org/plugins/duplicator"  title="Duplicator – WordPress Migration &amp; Backup Plugin" rel="noopener">Duplicator</a> to handle this.</p>



<p>On the other hand, if you don&#8217;t have access to the WordPress admin area, then you can <a href="https://www.wpbeginner.com/beginners-guide/how-to-make-a-wordpress-database-backup-manually/" title="How to Backup &amp; Restore Your WordPress Site with UpdraftPlus">manually create a WordPress backup</a> using phpMyAdmin and an FTP client. </p>



<p>After that, you can follow the following steps to troubleshoot and fix the internal server error on your website. </p>



<h4 id="aioseo-clear-wordpress-and-browser-cache">Clear WordPress and Browser Cache </h4>



<p>Browsers and your WordPress caching plugins can sometimes mistakenly store a cached copy of an error page. </p>



<p>The easiest way to fix this is by first <a href="https://www.wpbeginner.com/beginners-guide/how-to-clear-your-browser-cache-in-all-major-browsers-fast-way/" title="How to Clear Your Browser Cache in All Major Browsers (Fast Way)">clearing your browser cache</a>. </p>



<figure class="wp-block-image size-full"><img width="680" height="360" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/clearcache.png" alt="Clear cache" class="wp-image-171604" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/clearcache.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/clearcache-300x159.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>After that, if you have access to the WordPress admin area of your website, then you can empty the WordPress cache by visiting your caching plugin&#8217;s settings page. </p>



<p>For details, see our tutorial on <a href="https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/" title="How to Clear Your Cache in WordPress (Step by Step)">how to clear WordPress cache</a>. </p>



<h4 id="aioseo-checking-for-corrupt-htaccess-file">Checking for Corrupt .htaccess File</h4>



<p>The .htaccess file is a server configuration file that is also used by WordPress to set up redirects. </p>



<p>One of the most common causes of the internal server error is the corrupt .htaccess file. </p>



<p>The easiest way to fix this is by simply visiting the<strong> Settings » Permalinks</strong> page in the WordPress admin area and then clicking on the &#8216;Save Changes&#8217; button without making any changes at all. </p>



<figure class="wp-block-image size-full"><img width="680" height="335" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/update-permalinks.png" alt="Update permalinks to regenerate .htaccess file" class="wp-image-171588" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/update-permalinks.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/update-permalinks-300x148.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>WordPress will now try to update your .htaccess file or generate a new one for you.  You can now visit your website to see if this has resolved the internal server error. </p>



<p>If you can still see the error, then you need to make sure that WordPress was able to generate or write to the .htaccess file. </p>



<p>Sometimes, due to <a href="https://www.wpbeginner.com/beginners-guide/how-to-fix-file-and-folder-permissions-error-in-wordpress/" title="How to Fix File and Folder Permissions Error in WordPress">file and directory permissions</a>, WordPress may not be able to create or write to your .htaccess file. </p>



<p>You can now try to manually replace the .htaccess file. First, you need to login to your website <a href="https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/" title="How to Use FTP to Upload Files to WordPress for Beginners">using FTP</a> or the File Manager app under your hosting account control panel. </p>



<p>Next, you need to rename your main .<a title="What is .htaccess File in WordPress?" href="https://www.wpbeginner.com/glossary/htaccess/">htaccess file</a> to something like .htaccess_old. This lets you keep the file as a backup, but WordPress won&#8217;t recognize it.</p>



<p>To rename the .htaccess file, you will need to login to your site <a title="How to use FTP to upload files to WordPress for Beginners" href="https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/">using FTP</a> or File Manager app in your hosting account&#8217;s cPanel dashboard.</p>



<p>Once you are connected, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.</p>



<p>Simply, right-click on the .htaccess file and rename it to .htaccess_old. </p>



<figure class="wp-block-image size-full"><img width="680" height="341" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/rename-htaccess.png" alt="Rename .htaccess file" class="wp-image-171589" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/rename-htaccess.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/rename-htaccess-300x150.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Next, you need to create a new .htaccess file. </p>



<p>Inside your site&#8217;s root folder, right-click and then select &#8216;Create new file&#8217; option in your FTP client or File Manager app. </p>



<figure class="wp-block-image size-full"><img width="680" height="312" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/newhtaccessfile.png" alt="Create new htaccess file" class="wp-image-171587" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/newhtaccessfile.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/newhtaccessfile-300x138.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Name this new file .htaccess and click OK to save it. </p>



<p>Now, this .htaccess file is currently empty and you need to add default WordPress rewrite rules to it. </p>



<p>Simply right-click on the file and then select View/Edit in your FTP client or File Manager app. </p>



<figure class="wp-block-image"><img width="550" height="321" src="https://www.wpbeginner.com/wp-content/uploads/2018/01/edit-htaccess-file.png" alt="Editing .htaccess file in WordPress" class="wp-image-50178" title="Editing .htaccess file in WordPress" srcset="https://www.wpbeginner.com/wp-content/uploads/2018/01/edit-htaccess-file.png 550w, https://www.wpbeginner.com/wp-content/uploads/2018/01/edit-htaccess-file-300x175.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></figure>



<p>The empty file will open in a plain text editor like Notepad or TextEdit. Now, you need to copy and <a href="https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/" title="Beginner’s Guide to Pasting Snippets from the Web into WordPress">paste the following code</a> inside it. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: php; title: ; notranslate">
# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - &#91;L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php &#91;L]
&lt;/IfModule&gt;
# END WordPress
</pre></div>


<p>This code is the default rule set used by WordPress. Don&#8217;t forget to save your changes and upload the file back to the server. </p>



<p>You can now visit your website to see if this has resolved the internal server error. </p>



<p>If it did, then give yourself a pat on the back because you fixed the internal server error.</p>



<p><strong>Important:</strong> Before you move on with other things, make sure that you go to <strong>Settings » Permalinks</strong> page in the WordPress admin area and click the save button without making any changes. This will regenerate the .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a <a title="How to Fix WordPress Posts Returning 404 Error" href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/">404 error</a>.</p>



<p>If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.</p>



<h4 id="aioseo-increasing-the-php-memory-limit">Increasing the PHP Memory Limit</h4>



<p>Sometimes the internal server error can happen if a script is consuming all the PHP memory limit. </p>



<p>The easiest way to increase the PHP memory limit is by <a href="https://www.wpbeginner.com/beginners-guide/how-to-edit-wp-config-php-file-in-wordpress/" title="How to Edit wp-config.php File in WordPress">editing the wp-config.php</a> file. Be careful when you do this if you&#8217;re a beginner. You want to follow these instructions carefully because even small mistakes in WordPress core files can break your site.</p>



<p>To begin, simply connect to your WordPress website using an FTP client or the File Manager app under your <a href="https://www.wpbeginner.com/showcase/best-monthly-web-hosting-plans/" title="5 Best Monthly Web Hosting Plans (Starts at $4.95/mo.)">hosting account</a> control panel. </p>



<p>You&#8217;ll find wp-config.php file inside the main folder of your website. Right-click on it and select &#8216;Download.&#8217; This will ensure that you have a backup of the file in case something goes wrong.</p>



<p>When you&#8217;ve saved that, you can right-click on it and select &#8216;View/Edit.&#8217; </p>



<figure class="wp-block-image size-full"><img width="680" height="275" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/edit-wp-config-file.png" alt="Edit wp-config file" class="wp-image-171590" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/edit-wp-config-file.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/edit-wp-config-file-300x121.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Inside the wp-config.php file, you need to add the following code just above the line that reads &#8216;That&#8217;s all, stop editing! Happy publishing&#8217;.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: php; title: ; notranslate">
define( 'WP_MEMORY_LIMIT', '256M' );
</pre></div>


<p>For more details, see our tutorial on <a title="How to Increase PHP Memory Limit in WordPress" href="https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/">how to increase PHP memory limit in WordPress</a>.</p>



<p>If you are seeing the internal server error only when you try to log in to your WordPress admin or upload an image in your wp-admin, then you should increase the memory limit by following these steps:</p>



<ol><li>Create a blank text file on your computer and name it php.ini</li><li>Paste this code in there: memory=256MB</li><li>Save the file</li><li>Upload it into your /wp-admin/ folder using FTP</li></ol>



<p>If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.</p>



<p>This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your <a title="Best WordPress Hosting Company" href="https://www.wpbeginner.com/wordpress-hosting/">WordPress web hosting company</a> to look into the server logs to help you find the exact diagnostics.</p>



<p>If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.</p>



<h4 id="aioseo-deactivate-all-wordpress-plugins">Deactivate All WordPress Plugins</h4>



<p>If none of the above solutions worked for you, then this error is most likely being caused by a specific plugin installed on your website. </p>



<p>It is also possible that it is a combination of plugins that are not playing nice with each other.</p>



<p>If you can access the WordPress admin area of your website, then you can simply go to the plugins page and deactivate all WordPress plugins. </p>



<figure class="wp-block-image size-full"><img width="680" height="304" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/deactivate-all-plugins.png" alt="Deactivate all plugins" class="wp-image-171591" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/deactivate-all-plugins.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/deactivate-all-plugins-300x134.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>However, if you are unable to access the WordPress admin area, then you can deactivate all WordPress plugins using FTP. </p>



<p>Simply connect to your WordPress website using an FTP client or the file manager app under your hosting account control panel. </p>



<p>Once connected, navigated to the /wp-content/ folder and rename the plugins folder to plugins.deactivated. </p>



<figure class="wp-block-image size-full"><img width="680" height="252" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/plugins-deactivate-ftp.png" alt="Plugins deactivated via FTP" class="wp-image-171592" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/plugins-deactivate-ftp.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/plugins-deactivate-ftp-300x111.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>WordPress looks for plugins in the plugins folder. If the plugins folder is not found, then it will automatically deactivate all plugins. </p>



<p>You can now try visiting your website to see if this resolved the internal server error on your website. </p>



<p>To restore all your plugins, you can simply rename the plugins.deactivated folder back to plugins. </p>



<p>Your plugins will now be restored but they will still be deactivated. </p>



<p>You can now activate plugins one by one and visit your website to figure out which plugin is causing the internal server error. </p>



<p>For more details, see our guide on <a title="Deactivate all plugins in WordPress" href="https://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/">how to deactivate all WordPress plugins without WP-Admin</a>.</p>



<p>If deactivating all plugins didn&#8217;t fix the internal server error on your website, then continue reading.</p>



<h4 id="aioseo-switch-to-a-default-wordpress-theme">Switch to a Default WordPress Theme</h4>



<p>One possible cause of the internal server error could be some code in your WordPress theme. </p>



<p>To find out if this is the case, you need to switch your theme to a default WordPress theme. </p>



<p>If you have access to the WordPress admin area, then simply go to the <strong>Appearance » Themes</strong> page. If you have a default theme already installed then you can simply click on the Activate button to switch theme. </p>



<figure class="wp-block-image size-full"><img width="680" height="287" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/activate-theme.png" alt="Activate a default theme" class="wp-image-171593" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/activate-theme.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/activate-theme-300x127.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>If you don&#8217;t have a default theme installed, then you can click on the Add New button at the top and install a default theme (Twenty Twenty-Three, Twenty Twenty-Two, etc). </p>



<p>Now in case you don&#8217;t have access to the WordPress admin area, you can still switch to a default theme.</p>



<p>Simply, connect to your WordPress website using an FTP client and navigate to the /wp-content/ folder. </p>



<p>Right-click to select the themes folder and download it to your computer as a backup. </p>



<figure class="wp-block-image size-full"><img width="685" height="236" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-folder.png" alt="Download theme folder" class="wp-image-171605" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-folder.png 685w, https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-folder-300x103.png 300w" sizes="(max-width: 685px) 100vw, 685px" /></figure>



<p>Next, you need to delete the themes folder from your website. Once it is deleted, go ahead and create a new themes folder. </p>



<p>Your new themes folder will be completely empty which means you don&#8217;t have any WordPress themes installed at the moment. </p>



<p>Next, you need to visit the WordPress <a href="https://wordpress.org/themes/"  rel="noopener nofollow" title="themes directory">themes directory</a> and download a default WordPress theme to your computer. </p>



<figure class="wp-block-image size-full"><img width="680" height="348" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-file.png" alt="Download a default theme" class="wp-image-171594" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-file.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/download-theme-file-300x154.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Your browser will then download the theme as a zip file to your computer. </p>



<p>Locate the file on your computer and then unzip it. Windows users can unzip file by right-clicking on it and then selecting Extract All. Mac users can double-click on the zip file to extract it. </p>



<figure class="wp-block-image size-full"><img width="718" height="305" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/extract-theme-files.png" alt="Extract theme files" class="wp-image-171595" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/extract-theme-files.png 718w, https://www.wpbeginner.com/wp-content/uploads/2013/01/extract-theme-files-300x127.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></figure>



<p>You&#8217;ll now see a folder containing your WordPress theme. </p>



<p>Switch back to your FTP client or File Manager up and upload this folder to the empty themes folder. </p>



<figure class="wp-block-image size-full"><img width="589" height="237" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-theme-files.png" alt="Upload theme files" class="wp-image-171596" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-theme-files.png 589w, https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-theme-files-300x121.png 300w" sizes="(max-width: 589px) 100vw, 589px" /></figure>



<p>Once uploaded, WordPress will automatically start using the default theme. </p>



<p>You can now visit your website to see if this resolved the internal server error. </p>



<p>If this didn&#8217;t work, then you can reupload your WordPress themes from the backup or switch back to the theme you were using. </p>



<p>Don&#8217;t worry there are still a few more things you can do to fix the error. </p>



<h4 id="aioseo-re-uploading-core-files">Re-uploading Core Files</h4>



<p>If the plugin and theme options didn&#8217;t fix the internal server error, then it is worth re-uploading the /wp-admin/ and /wp-includes/ folders from a fresh WordPress install.</p>



<p>This will NOT remove any of your information, but it may solve the problem in case any file was corrupted.</p>



<p>First, you will need to visit the WordPress.org website and click on the Download button.</p>



<figure class="wp-block-image size-full"><img width="680" height="306" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-wordpress.png" alt="Download WordPress" class="wp-image-171597" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/download-wordpress.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/download-wordpress-300x135.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>This will download the WordPress zip file to your computer. </p>



<p>Go ahead and extract the zip file. Inside it, you will find a wordpress folder.</p>



<figure class="wp-block-image size-full"><img width="680" height="195" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/wordpress-folder-extracted.png" alt="WordPress folder extracted" class="wp-image-171599" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/wordpress-folder-extracted.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/wordpress-folder-extracted-300x86.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Next you need to connect to your WordPress website using an FTP client. </p>



<p>Once connected go to the root folder of your website. It is the folder that has wp-admin, wp-includes, wp-content folders inside it.</p>



<p>In the left column open the WordPress folder on your computer. </p>



<p>Now you need to select all files inside the wordpresss folder and upload them to your website. </p>



<figure class="wp-block-image size-full"><img width="680" height="279" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-core-files.png" alt="Upload core WordPress files" class="wp-image-171600" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-core-files.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/upload-core-files-300x123.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Your FTP client will now transfer those folders to your server. </p>



<p>It will ask you whether you would like to overwrite the files. Select &#8216;Overwrite&#8217; and then select &#8216;Always use this action&#8217;.</p>



<figure class="wp-block-image size-full"><img width="680" height="293" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/overwrite-files.png" alt="Overwrite WordPress core files" class="wp-image-171601" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/overwrite-files.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/overwrite-files-300x129.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Your FTP client will now replace your older WordPress files with new, fresh copies. </p>



<p>If your WordPress files were corrupted, then this step will fix the internal server error for you.</p>



<h4 id="aioseo-enable-debug-logs-in-wordpress">Enable Debug Logs in WordPress</h4>



<p>WordPress comes with a built-in system to keep logs for debugging. </p>



<p>You can turn it on by using the <a href="https://wordpress.org/plugins/wp-debugging/"  rel="noopener nofollow" title="WP Debugging">WP Debugging</a> plugin. For more details, see our guide on <a href="https://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" title="How to Install a WordPress Plugin – Step by Step for Beginners">how to install a WordPress plugin</a>. </p>



<p>Once activated, the plugin will turn on debugging logs on your WordPress website. </p>



<p>If you don&#8217;t have access to the admin area of your WordPress website, then you can turn on debugging by adding the following code to your wp-config.php file. </p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: php; title: ; notranslate">
define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true); 
</pre></div>


<p>Once you have turned on debug logs, you can view these logs by using an FTP client and navigating to the /wp-content/ folder. </p>



<figure class="wp-block-image size-full"><img width="680" height="298" src="https://www.wpbeginner.com/wp-content/uploads/2013/01/debuglog.png" alt="Debug log" class="wp-image-171602" srcset="https://www.wpbeginner.com/wp-content/uploads/2013/01/debuglog.png 680w, https://www.wpbeginner.com/wp-content/uploads/2013/01/debuglog-300x131.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>You can open the debug log file in a text editor and it will show you a list of errors and warnings that occur on your website. </p>



<p>Some of these errors and warnings can be harmless incidents that may not need fixing. However, if you are seeing an internal server error on your website then these may point you in the right direction.</p>



<h4 id="aioseo-ask-your-hosting-provider">Ask your Hosting Provider</h4>



<p>If all methods fail to fix the internal server error on your website, then it is time to get some more help. Contact your <a href="http://wpbeginner.com/hosting" title="Hosting">web hosting</a> support team and they will be able to check the server logs and locate the root cause of the error.</p>



<p>If you want to continue troubleshooting on your own, then see our <a href="https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/" title="Beginner’s Guide to Troubleshooting WordPress Errors (Step by Step)">ultimate WordPress troubleshooting guide for beginners</a>.</p>



<p>We hope this article helped you fix the internal server error in WordPress. You may also want to see our complete list of the <a title="25 Most Common WordPress Errors and How to Fix Them" href="https://www.wpbeginner.com/common-wordpress-errors-and-how-to-fix-them/">most common WordPress errors</a>, and our guide on <a href="https://www.wpbeginner.com/wordpress-hosting/" title="How to Choose the Best WordPress Hosting (Compared)">how to choose the best web hosting provider</a>.</p>



<p>If you liked this article, then please subscribe to our <a href="https://youtube.com/wpbeginner?sub_confirmation=1"  rel="noreferrer noopener nofollow" title="Subscribe to WPBeginner YouTube Channel">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="https://twitter.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Follow WPBeginner on Twitter">Twitter</a> and <a href="https://facebook.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Join WPBeginner Community on Facebook">Facebook</a>.</p><p>The post <a href="https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-internal-server-error-in-wordpress/">How to Fix the 500 Internal Server Error in WordPress</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/tutorials/how-to-fix-the-500-internal-server-error-in-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
		<item>
		<title>How to Stop WordPress From Overwriting .htaccess File</title>
		<link>http://www.wpwife.com/tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file</link>
		<comments>http://www.wpwife.com/tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file#comments</comments>
		<pubDate>Thu, 23 Feb 2023 09:45:00 +0000</pubDate>
		<dc:creator><![CDATA[Editorial Staff]]></dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[modifying .htaccess]]></category>
		<category><![CDATA[overwriting .htaccess]]></category>
		<category><![CDATA[stop wordpress overwriting .htaccess]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress .htaccess]]></category>

		<guid isPermaLink="false">https://www.wpbeginner.com/?p=166840</guid>
		<description><![CDATA[
<p>Recently one of our readers asked if it was possible to stop WordPress from overwriting the custom code in your .htaccess file? WordPress along with several plugins add custom settings to the .htaccess configuration file. If you have added your own custom code to .htaccess,&#8230;&#160;<strong><a href="https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/">Read More &#187;</a></strong></p>
<p>The post <a href="https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/">How to Stop WordPress From Overwriting .htaccess File</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Recently one of our readers asked if it was possible to stop WordPress from overwriting the custom code in your .htaccess file?</p>



<p>WordPress along with several plugins add custom settings to the .htaccess configuration file. If you have added your own custom code to .htaccess, then you may be worried that it will be overwritten or deleted.</p>



<p>In this article, we’ll show you how to stop WordPress from overwriting the .htaccess file.</p>



<figure class="wp-block-image size-full"><img width="680" height="385" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/how-to-stop-wordpress-from-modifying-htaccess-file-og.png" alt="How to Stop WordPress From Overwriting .htaccess File" class="wp-image-166878" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/how-to-stop-wordpress-from-modifying-htaccess-file-og.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/how-to-stop-wordpress-from-modifying-htaccess-file-og-300x170.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<h4>Why Does WordPress Overwrite the .htaccess File?</h4>



<p>Your <a title="What Is .htaccess in WordPress?" href="https://www.wpbeginner.com/glossary/htaccess/">.htaccess</a> file is a powerful configuration file that stores important settings about your <a title="How to Make a WordPress Website - Easy Tutorial - Create Website" href="https://www.wpbeginner.com/guides/">WordPress website</a>. It contains rules that tell your hosting server how to handle your site.</p>



<p>WordPress uses the .htaccess file to store its permalink settings. Whenever you change or <a title="How to Regenerate Your Permalinks in WordPress" href="https://www.wpbeginner.com/beginners-guide/how-to-regenerate-your-permalinks-in-wordpress/">regenerate your permalinks</a>, WordPress will automatically overwrite the old settings in .htaccess with the new settings.</p>



<p>Some WordPress plugins also save their settings in .htaccess. For example, the <a title="How to Install and Setup W3 Total Cache for Beginners" href="https://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/">W3 Total Cache</a>&nbsp;plugin will modify your .htaccess file in order to configure the caching and optimization tools that are part of the plugin.</p>



<p>Lastly, you can make your own <a href="https://www.wpbeginner.com/wp-tutorials/9-most-useful-htaccess-tricks-for-wordpress/" title="12 Most Useful .htaccess Tricks for WordPress">custom changes to .htacess</a> to control how your website works. For example, you can add custom rules to the file that protect your admin area, keep your site safe from hackers, set up redirects, ban suspicious IP addresses, and more.</p>



<p>Some users are concerned that if they add their own custom rules to .htaccess, then they may be deleted when WordPress overwrites the file with new settings. Other users prefer to manually configure .htaccess and not let WordPress write to it at all.</p>



<p>With that being said, let’s take a look at how to stop WordPress from overwriting your .htaccess file. Simply use the quick links below to jump to the section you are interested in.</p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/#aioseo-how-to-stop-wordpress-from-overwriting-your-custom-htaccess-rules">How to Stop WordPress From Overwriting Your .htaccess Rules</a></li><li><a href="https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/#aioseo-how-to-stop-wordpress-from-making-any-changes-to-htaccess">How to Stop WordPress From Modifying .htaccess</a></li></ul></div>



<h4 id="aioseo-how-to-stop-wordpress-from-overwriting-your-custom-htaccess-rules">How to Stop WordPress From Overwriting Your .htaccess Rules</h4>



<p>The good news is that if you understand how the .htaccess file works, then you can be confident that your custom rules will not be overwritten.</p>



<p>That’s because the areas of the file that will be changed by WordPress or your plugins are clearly marked. Simply make sure that you don&#8217;t add code to those areas.</p>



<p><strong>Don’t Modify Code Inside the WordPress Markers</strong></p>



<p>As we said earlier, WordPress uses .htaccess to store the settings for an&nbsp;<a title="What is a SEO Friendly URL Structure in WordPress" href="https://www.wpbeginner.com/wp-tutorials/seo-friendly-url-structure-for-wordpress/">SEO-friendly URL</a>&nbsp;structure. The code it saves to the file will be automatically overwritten and updated whenever you change your permalink settings.</p>



<p>As you can see in the screenshot below, WordPress saves this information between two markers, <code># BEGIN WordPress</code> and <code># END WordPress</code>.</p>



<figure class="wp-block-image size-full"><img width="680" height="270" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginwordpress.png" alt="WordPress Markers in .htaccess" class="wp-image-166842" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginwordpress.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginwordpress-300x119.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Notice the warning inside those markers:</p>



<p><em>The directives (lines) between &#8220;BEGIN WordPress&#8221; and &#8220;END WordPress&#8221; are dynamically generated, and should only be modified via WordPress filters. Any changes to the directives between these markers will be overwritten.</em></p>



<p>This means that WordPress will not overwrite or modify any code that you add outside these markers. Users typically add their custom code to the top of the file, above the <code># BEGIN WordPress</code> marker.</p>


<div class="wpb-alert style-yellow">

<p><meta charset="utf-8"><strong>Tip:</strong> .htaccess is a hidden file located in your WordPress site’s root folder. If you are having difficulties finding it, then take a look at our guide on <a title="Why You Can’t Find .htaccess File on Your WordPress Site" href="https://www.wpbeginner.com/beginners-guide/why-you-cant-find-htaccess-file-on-your-wordpress-site/">why you can’t find the .htaccess file on your WordPress site</a>.</p>

</div>


<p><strong>Don’t Modify Code Inside Your Plugins’ Markers</strong></p>



<p>When a plugin saves its settings to .htaccess, it also places it between markers that look like <code># BEGIN Plugin</code> and <code># END Plugin</code>.</p>



<p>For example, if you <a title="How to Install and Setup W3 Total Cache for Beginners" href="https://www.wpbeginner.com/plugins/how-to-install-and-setup-w3-total-cache-for-beginners/">install and set up the W3 Total Cache plugin</a> to improve your website speed and performance, then it will add rules to .htaccess between <code># BEGIN W3TC Browser Cache</code> and <code># END W3TC Browser Cache</code> markers.</p>



<figure class="wp-block-image size-full"><img width="680" height="290" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginw3tc.png" alt="Example of Plugin Markers in .htaccess" class="wp-image-166845" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginw3tc.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessbeginw3tc-300x128.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>These rules will be overwritten whenever you change the plugin’s settings, so you need to be careful not to add your own custom .htaccess rules between those markers.</p>



<p><strong>Creating Markers for Your Custom Code</strong></p>



<p>In rare cases, a badly behaved plugin may modify code outside of its <code># BEGIN</code> and <code># END</code> markers. However, it will normally not modify code found between the markers used by WordPress or other plugins.</p>



<p>If you are concerned about a badly behaved plugin overwriting your code, then you can add your own markers to the .htaccess file.</p>



<p>For example, you can type <code># BEGIN MyCustomCode</code> and <code># END MyCustomCode</code> markers at the top of the .htaccess file, and then add your own custom rules between those markers.</p>



<figure class="wp-block-image size-full"><img width="680" height="401" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessmarkerscustom.png" alt="You Can Create Your Own Markers in .htaccess for Your Custom Rules" class="wp-image-167052" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessmarkerscustom.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessmarkerscustom-300x177.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>If you also need to add code to the end of .htaccess, then you can add a different set of markers there. Just be sure to give them different names. For example, you could use &#8216;MyCustomCodeTop&#8217; and &#8216;MyCustomCodeBottom&#8217;.</p>



<h4 id="aioseo-how-to-stop-wordpress-from-making-any-changes-to-htaccess">How to Stop WordPress From Modifying .htaccess</h4>



<p>Now that you understand how .htaccess works, you <meta charset="utf-8">can be confident that your custom code will not be overwritten by WordPress or your plugins.</p>



<p>However, some developers and advanced users want to stop WordPress from making any changes to .htaccess.</p>



<p>For example, they may want to create permalinks by typing the settings manually into .htaccess. In this case, they will want to avoid conflicts by stopping WordPress from saving its own permalink settings to the file.</p>



<p>We don’t recommend this unless you know what you’re doing, because it can lead to unexpected consequences. However, it can be done by changing the file’s permissions or using code.</p>



<p><strong>Stopping WordPress From Changing .htaccess Using File Permissions</strong></p>



<p>One way to stop WordPress from modifying .htaccess is to make the file read-only. To do this, you need to change the file permissions using an <a href="https://www.wpbeginner.com/showcase/6-best-ftp-clients-for-wordpress-users/" title="6 Best FTP Clients for Mac and Windows WordPress Users">FTP client</a> or the file manager provided by your <a href="https://www.wpbeginner.com/wordpress-hosting/" title="How to Choose the Best WordPress Hosting in 2023 (Compared)">WordPress hosting provider</a>.</p>



<p>You will find the .htaccess file in the root directory of your WordPress installation. Next, you should right-click the file and select ‘File permissions’.</p>



<figure class="wp-block-image size-full"><img width="680" height="357" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsmenu.png" alt="Selecting File Permissions From the Menu in Your FTP Client" class="wp-image-166848" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsmenu.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsmenu-300x158.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>This will display a pop-up where you can <a href="https://www.wpbeginner.com/beginners-guide/how-to-fix-file-and-folder-permissions-error-in-wordpress/" title="How to Fix File and Folder Permissions Error in WordPress">change the file’s attributes</a>.</p>



<p>The default setting will be 644, but you can change this to 444 by typing directly into the &#8216;Numeric value&#8217; field or making sure that only the ‘Read’ boxes are checked.</p>



<figure class="wp-block-image size-full"><img width="680" height="380" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsettings.png" alt="Changing the .htaccess File Permissions to 444 or Read-Only" class="wp-image-166850" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsettings.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccessfilepermissionsettings-300x168.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>Once you click the ‘OK’ button, the file will be read-only and cannot be modified.</p>



<p>Of course, this will mean that you are unable to write to the file as well. When you wish to make changes, you will need to temporarily set the file permissions back to 644.</p>



<p><strong>Stopping WordPress From Changing .htaccess Using Code</strong></p>



<p>Another solution is to use a code snippet that lets WordPress know not to write to the .htaccess file. This is useful if you want to stop WordPress from modifying .htaccess without blocking your plugins.</p>



<p><strong>Note:</strong> Editing any core WordPress files can be dangerous. Even a small mistake can cause major errors on your site. That&#8217;s why we only recommend this method for advanced users.</p>



<p>Simply add the following code snippet at the end of your wp-config.php file. If you need help, then please refer to our guide on <a title="How to Edit wp-config.php File in WordPress" href="https://www.wpbeginner.com/beginners-guide/how-to-edit-wp-config-php-file-in-wordpress/">how to edit the wp-config.php file in WordPress</a>.</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: php; gutter: false; title: ; notranslate">
add_filter('got_rewrite', '__return_false');
</pre></div>


<p>Once you&#8217;ve done that, WordPress will no longer write to the .htaccess file.</p>



<p><strong>Error Message Displayed When WordPress Can’t Change .htaccess</strong></p>



<p>If you try to change your permalink settings when .htaccess is set to read-only, then an error message will be displayed.</p>



<p>At the top of the <strong>Settings » Permalinks</strong> page, you will see the message ‘You should update your .htaccess file now.&#8217;</p>



<figure class="wp-block-image size-full"><img width="680" height="158" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserroryoushouldupdate.png" alt="Permalink Settings Error Message When .htaccess Cannot Be Accessed" class="wp-image-166853" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserroryoushouldupdate.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserroryoushouldupdate-300x70.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>This lets you know that WordPress was unable to modify the .htaccess file.</p>



<p>Normally, this is what you intended. However, if you do wish to add the WordPress permalink settings to .htaccess, then you will need to do it manually.</p>



<p>At the bottom of the <strong>Settings ≫ Permalinks</strong> page, you will see another error message saying that your .htaccess file is not writable. Underneath that, you will see the rules that need to be added to .htaccess.</p>



<figure class="wp-block-image size-full"><img width="680" height="213" src="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserrornotwritable.png" alt="List of Rules You Will Need to Add to .htaccess Manually if Needed" class="wp-image-166855" srcset="https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserrornotwritable.png 680w, https://www.wpbeginner.com/wp-content/uploads/2023/02/htaccesswordpresserrornotwritable-300x94.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></figure>



<p>If you wish to add those settings, then you will need to temporarily change the .htaccess file permissions back to 644 so that it can be edited. After that, you should paste the rules between the file&#8217;s WordPress BEGIN and END markers, replacing the code already there.</p>



<p>When you&#8217;re finished, simply set the value back to 444 and save the file. It will once again be unwritable.</p>



<p>We hope this tutorial helped you learn how to stop WordPress from overwriting the .htaccess file. You may also want to learn <a title="How to Add Web Push Notification to Your WordPress Site" href="https://www.wpbeginner.com/wp-tutorials/how-to-add-web-push-notification-to-your-wordpress-site/">how to add push notification in WordPress</a> and check out our expert list of <a title="14 Best WordPress SEO Plugins and Tools That You Should Use" href="https://www.wpbeginner.com/showcase/9-best-wordpress-seo-plugins-and-tools-that-you-should-use/">the best WordPress SEO plugins and tools</a>.</p>



<p>If you liked this article, then please subscribe to our <a href="https://youtube.com/wpbeginner?sub_confirmation=1"  rel="noreferrer noopener nofollow" title="Subscribe to WPBeginner YouTube Channel">YouTube Channel</a> for WordPress video tutorials. You can also find us on <a href="https://twitter.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Follow WPBeginner on Twitter">Twitter</a> and <a href="https://facebook.com/wpbeginner"  rel="noreferrer noopener nofollow" title="Join WPBeginner Community on Facebook">Facebook</a>.</p><p>The post <a href="https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/">How to Stop WordPress From Overwriting .htaccess File</a> first appeared on <a href="https://www.wpbeginner.com/">WPBeginner</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.wpwife.com/tutorials/how-to-stop-wordpress-from-overwriting-htaccess-file/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="0" type="" />
		</item>
	</channel>
</rss>
