<?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>wp-config - Matteo Cisilino</title>
	<atom:link href="https://www.cisilino.com/en/tag/wp-config-en/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cisilino.com/en/</link>
	<description>Guide su WordPress, server e sicurezza</description>
	<lastBuildDate>Wed, 11 Nov 2026 17:52:26 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>WordPress hardening with .htaccess: what to switch on</title>
		<link>https://www.cisilino.com/en/2026/11/11/wordpress-hardening-htaccess/</link>
					<comments>https://www.cisilino.com/en/2026/11/11/wordpress-hardening-htaccess/#respond</comments>
		
		<dc:creator><![CDATA[matteocisilino]]></dc:creator>
		<pubDate>Wed, 11 Nov 2026 17:44:00 +0000</pubDate>
				<category><![CDATA[csdn]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[hardening]]></category>
		<category><![CDATA[WordPress security]]></category>
		<category><![CDATA[wp-config]]></category>
		<category><![CDATA[XML-RPC]]></category>
		<guid isPermaLink="false">https://www.cisilino.com/?p=165</guid>

					<description><![CDATA[<p>WordPress hardening with .htaccess in a single section: what you can switch on, what might break and how the plugin writes the rules.</p>
<p>The post <a href="https://www.cisilino.com/en/2026/11/11/wordpress-hardening-htaccess/">WordPress hardening with .htaccess: what to switch on</a> first appeared on <a href="https://www.cisilino.com/en/">Matteo Cisilino</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>WordPress hardening with <code>.htaccess</code></strong> is the set of measures you wish you had put in place after the fact. The plugin gathers them in a single section. They are all off by default: you decide what to switch on. Every item says what it does and what it can break.</p>
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" src="https://www.cisilino.com/wp-content/uploads/2026/10/wordpress-hardening-htaccess.webp" alt="WordPress hardening: three concentric circles with gaps, green, teal and purple, around a dot" width="1200" height="630"/></figure>
<h2>The WordPress hardening switches</h2>
<p>These are the WordPress hardening switches you can turn on one at a time:</p>
<ul>
<li><strong>No PHP in <code>wp-content/uploads</code></strong>, including the <code>.phar</code>, <code>.phps</code> and <code>.pht</code> extensions. It is the most effective protection against webshells disguised as images.</li>
<li><strong>Directory listing disabled</strong> where there is no <code>index</code> file.</li>
<li><strong>Direct access blocked</strong> to <code>wp-config.php</code>, <code>.htaccess</code>, <code>readme.html</code> and <code>debug.log</code>.</li>
<li><strong>Custom paths</strong> to block.</li>
<li><strong>XML-RPC disabled</strong>, a frequent target.</li>
<li><strong>User enumeration</strong> via <code>?author=N</code> blocked, because it reveals usernames.</li>
<li><a href="https://www.cisilino.com/en/2026/10/29/cisilino-site-defense-network-security-plugin/">Cisilino Site Defense Network: the WordPress security plugin</a></li>
</ul>
<h2>What can break</h2>
<p>Not every WordPress hardening switch suits every site: XML-RPC is needed by some apps and publishing services, so if you use them, leave it as it is. The PHP block in <code>uploads</code> can stop a plugin that used to put code there. Blocking <code>debug.log</code>, on the other hand, never causes problems.</p>
<p>Custom paths: since version 1.0.3 the plugin never writes quotes or control characters into the rules it creates from your paths. Before, the customisation was not filtered enough and a badly written path could produce an invalid .htaccess and block the whole site. We chose the safest route: those characters are discarded silently when the rule is written. So you never have to deal with an error. In the field they stay as you typed them, but have no effect.</p>
<h2>How WordPress hardening writes the rules</h2>
<p>The rules end up in <code>.htaccess</code>. We removed the <code>php_admin_flag</code> directive. On PHP-FPM or CGI hosting with Apache it caused a 500 error on the whole site. <code>Require all denied</code> alone is enough. If you deactivate the plugin the rules disappear, reactivate it and they come back. For background, the Apache guide to <a href="https://httpd.apache.org/docs/2.4/howto/htaccess.html" target="_blank" rel="noopener">.htaccess files</a> is the reference.</p>
<p>A practical tip: switch on one WordPress hardening option at a time. Look at the site, run the built-in test and only then move on to the next.</p>
<h2>Frequently asked questions</h2>
<h3>What is WordPress hardening?</h3>
<p>The set of measures that reduce the attack surface: no PHP in uploads, sensitive files protected, XML-RPC and user enumeration closed.</p>
<h3>Can disabling XML-RPC cause problems?</h3>
<p>Yes, if you use apps or services that need it. In that case it is better to leave it on.</p>
<h3>What happens to the rules if I deactivate the plugin?</h3>
<p>They are removed from .htaccess. When you reactivate the plugin they come back as they were.</p>
<h2>Read more</h2>
<ul>
<li><a href="https://www.cisilino.com/en/2026/11/11/dangerous-file-uploads-wordpress/">Dangerous file uploads in WordPress: double extensions</a></li>
<li><a href="https://www.cisilino.com/?p=95">WordPress HTTP security headers and HSTS without server access</a></li>
</ul><p>The post <a href="https://www.cisilino.com/en/2026/11/11/wordpress-hardening-htaccess/">WordPress hardening with .htaccess: what to switch on</a> first appeared on <a href="https://www.cisilino.com/en/">Matteo Cisilino</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.cisilino.com/en/2026/11/11/wordpress-hardening-htaccess/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
