{"id":18441,"date":"2026-09-30T08:58:30","date_gmt":"2026-09-30T05:58:30","guid":{"rendered":"https:\/\/www.hyyat.com\/knowledgebase\/modsecurity-cpanel\/"},"modified":"2026-11-22T14:50:53","modified_gmt":"2026-11-22T11:50:53","password":"","slug":"modsecurity-cpanel","status":"publish","type":"docs","link":"https:\/\/www.hyyat.com\/en\/knowledgebase\/modsecurity-cpanel\/","title":{"rendered":"ModSecurity in cPanel: Your Site Firewall, and When to Turn It Off for One Domain"},"content":{"rendered":"<div class=\"hkb\" dir=\"ltr\">\n<div class=\"hkb-tldr\"><b>In short<\/b>ModSecurity is a firewall that checks every request to your site and blocks those that look like attacks. If you get a <b>403<\/b> or <b>406<\/b> error when saving a page or sending a form, ModSecurity may have stopped a harmless request. Do not turn it off for the whole site; send support the time and URL so we exclude only the rule responsible.<\/div>\n<div class=\"hy-vid\"><div style=\"width: 1280px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-18441-1\" width=\"1280\" height=\"720\" poster=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-cpanel-modsecurity-en.jpg\" preload=\"none\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-cpanel-modsecurity-en.mp4?_=1\" \/><a href=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-cpanel-modsecurity-en.mp4\">https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hyyat-cpanel-modsecurity-en.mp4<\/a><\/video><\/div><\/div>\n<div class=\"hkb-note\"><b>A question we often get:<\/b> &#8220;I try to save a WordPress post and get Forbidden. When I remove part of the text, it saves.&#8221;<\/div>\n<p>That is a classic ModSecurity case. The text contains something that looks like code, such as a script tag or an SQL statement in a tutorial, and the firewall takes it for an attack. The firewall was over-cautious; the fix is not to switch it off but to exclude the rule that misfired.<\/p>\n<h2>What ModSecurity does<\/h2>\n<p>It sits between visitors and your site and compares every request with rules describing known attacks: SQL injection, code injection, attempts to read system files and abusive bots. A matching request is refused before it reaches WordPress or any other software. To understand one of the best known attacks, read <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/sql-injection\/\">what SQL injection is<\/a>.<\/p>\n<h2>Signs ModSecurity blocked a harmless request<\/h2>\n<ul class=\"hkb-list\">\n<li>A 403 Forbidden or 406 Not Acceptable error when saving or submitting, not when opening the page.<\/li>\n<li>The problem only happens with certain text or a certain file.<\/li>\n<li>A line in <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-errors-raw-access-logs\/\">the Errors tool<\/a> containing ModSecurity and a rule number (id).<\/li>\n<\/ul>\n<figure class=\"hkb-fig\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.hyyat.com\/zasogooh\/2026\/11\/hkb-pf-en-c-sec.webp\" alt=\"The Security section in cPanel\" width=\"800\" height=\"451\" loading=\"lazy\" \/><\/figure>\n<h2>The ModSecurity tool in cPanel<\/h2>\n<p>On some servers a ModSecurity tool appears in the Security section, with an on and off switch per domain. If you do not see it in your panel, the firewall is managed on the server side and our support team adjusts it.<\/p>\n<div class=\"hkb-note warn\"><b>Never switch the firewall off for the whole site<\/b> to fix one form. That opens the site to every attack it was quietly stopping each day.<\/div>\n<h2>The right way to fix it<\/h2>\n<ol class=\"hkb-steps\">\n<li><b>Reproduce the error once<\/b> and note the time to the minute and the page URL.<\/li>\n<li><b>Open the Errors tool<\/b> and copy the line mentioning ModSecurity if there is one.<\/li>\n<li><b>Send <a href=\"https:\/\/hyyatdomain.com\/submitticket.php\" target=\"_blank\" rel=\"noopener\">a support ticket<\/a><\/b> with the time, the URL and the line.<\/li>\n<li><b>We exclude the rule<\/b> for that path or domain only, and the firewall keeps protecting the rest of the site.<\/li>\n<\/ol>\n<h2>Common errors that are not the firewall<\/h2>\n<div class=\"hkb-tbl\">\n<table>\n<thead>\n<tr>\n<th>Error<\/th>\n<th>Likely cause<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>403 on the whole site<\/td>\n<td>Wrong file permissions, a rule in .htaccess, or an <a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/block-ip-cpanel\/\">IP block<\/a><\/td>\n<\/tr>\n<tr>\n<td>500 when saving<\/td>\n<td>A WordPress plugin error; check the Errors tool<\/td>\n<\/tr>\n<tr>\n<td>413 when uploading<\/td>\n<td>The file is larger than the PHP limit<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>From our support desk<\/h2>\n<ul class=\"hkb-list\">\n<li><b>A tech blog<\/b> that publishes code in its posts failed to save every post containing an SQL statement. Excluding one rule for the save path in the WordPress dashboard fixed it without weakening the rest of the site.<\/li>\n<li><b>A contact form<\/b> rejected messages containing many links. A spam-prevention rule was the cause, and the fix was adjusting the form, not switching the firewall off.<\/li>\n<li><b>A product import plugin<\/b> sent large files that the firewall refused. Uploading the file with File Manager and importing from the server got round it.<\/li>\n<\/ul>\n<h2>Frequently asked questions<\/h2>\n<div class=\"hkb-faq\">\n<details>\n<summary>Is ModSecurity active on my hosting?<\/summary>\n<p>The firewall runs at server level. If its tool appears in Security, it lets you control it per domain.<\/p>\n<\/details>\n<details>\n<summary>Does ModSecurity slow my site?<\/summary>\n<p>Its effect on speed is tiny compared with the protection it gives.<\/p>\n<\/details>\n<details>\n<summary>How do I know the error comes from it?<\/summary>\n<p>Look for the word ModSecurity in the Errors tool in Metrics.<\/p>\n<\/details>\n<details>\n<summary>Can I exclude a rule myself?<\/summary>\n<p>On shared hosting it is done through support so server security is not affected.<\/p>\n<\/details>\n<details>\n<summary>Does ModSecurity protect me from every attack?<\/summary>\n<p>It stops many known attacks, but it does not replace updates and strong passwords.<\/p>\n<\/details>\n<details>\n<summary>Does the error look the same on every site?<\/summary>\n<p>No, it may be 403, 406 or a generic error page, but the line in the Errors tool names the cause.<\/p>\n<\/details>\n<\/div>\n<div class=\"hkb-rel\"><b>Related guides<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/block-ip-cpanel\/\">Block an IP Address or a Whole Range from Your Website in cPanel<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-errors-raw-access-logs\/\">Track Website Errors and Logs in cPanel: the Errors and Raw Access Tools<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/sql-injection\/\">What Is SQL Injection and How to Protect Your Website Database<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-two-factor-authentication\/\">Turn On Two-Factor Authentication in cPanel: Protection Even If Your Password Is Stolen<\/a><\/li>\n<li><a href=\"https:\/\/www.hyyat.com\/en\/knowledgebase\/cpanel-security-section\/\">The Security Section in cPanel: IP Blocker, SSL Certificates, Two-Factor Authentication and Hotlink Protection<\/a><\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.hyyat.com\/en\/kb\/website-control-panel-cpanel\/\">All cPanel guides \u2192<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In shortModSecurity is a firewall that checks every request to your site and blocks those that look like attacks. If you get a 403 or 406 error when saving a page or sending a form, ModSecurity may have stopped a harmless request. Do not turn it off for the whole site; send support the time [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":20954,"comment_status":"open","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"_templately_pack_id":"","_templately_imported_at":"","_templately_source":"","_templately_import_session_id":"","footnotes":""},"doc_category":[2749],"doc_tag":[],"class_list":["post-18441","docs","type-docs","status-publish","has-post-thumbnail","hentry","doc_category-website-control-panel-cpanel"],"year_month":"2026-11","word_count":728,"total_views":"3","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"ahmed fathy","author_nicename":"ahmed-fathy","author_url":"https:\/\/www.hyyat.com\/en\/author\/ahmed-fathy\/"},"doc_category_info":[{"term_name":"cPanel Guides","term_url":"https:\/\/www.hyyat.com\/en\/kb\/website-control-panel-cpanel\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/comments?post=18441"}],"version-history":[{"count":0,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/docs\/18441\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media\/20954"}],"wp:attachment":[{"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/media?parent=18441"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_category?post=18441"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.hyyat.com\/en\/wp-json\/wp\/v2\/doc_tag?post=18441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}