diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue
index a677529cc19d1e59deaff7243d112d3733ab3d59..3690f59852c4515eb579d8d535eb9ed9498b359a 100644
--- a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue
+++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue
@@ -230,8 +230,11 @@ export default {
     isAllBranchesRule() {
       return this.branch === this.$options.i18n.allBranches;
     },
+    isAllProtectedBranchesRule() {
+      return this.branch === this.$options.i18n.allProtectedBranches;
+    },
     isPredefinedRule() {
-      return this.isAllBranchesRule || this.branch === this.$options.i18n.allProtectedBranches;
+      return this.isAllBranchesRule || this.isAllProtectedBranchesRule;
     },
     hasPushAccessLevelSet() {
       return this.pushAccessLevels?.total > 0;
@@ -251,7 +254,11 @@ export default {
       return this.showApprovers || this.showSquashSetting;
     },
     showSquashSetting() {
-      return this.glFeatures.branchRuleSquashSettings && !this.branch?.includes('*'); // Squash settings are not available for wildcards
+      return (
+        this.glFeatures.branchRuleSquashSettings &&
+        !this.branch?.includes('*') &&
+        !this.isAllProtectedBranchesRule
+      ); // Squash settings are not available for wildcards or All protected branches
     },
     showEditSquashSetting() {
       return (
diff --git a/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js b/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js
index 24146e940b1a161e0d3988a105d32e2123b000ad..c2d4e340dd490bed76a8e612b4ed17add29b1bd5 100644
--- a/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js
+++ b/spec/frontend/projects/settings/branch_rules/components/view/index_spec.js
@@ -319,6 +319,22 @@ describe('View branch rules', () => {
 
       expect(findSquashSettingSection().exists()).toBe(false);
     });
+
+    it.each`
+      branch                      | expectedExists | description
+      ${'main'}                   | ${true}        | ${'shows squash section for regular branch'}
+      ${'All branches'}           | ${true}        | ${'shows squash section for all branches'}
+      ${'All protected branches'} | ${false}       | ${'hides squash section for protected branches'}
+      ${'feature-*'}              | ${false}       | ${'hides squash section for wildcard branches'}
+    `('$description', async ({ branch, expectedExists }) => {
+      jest.spyOn(util, 'getParameterByName').mockReturnValueOnce(branch);
+
+      await createComponent({
+        glFeatures: { branchRuleSquashSettings: true },
+      });
+
+      expect(findSquashSettingSection().exists()).toBe(expectedExists);
+    });
   });
 
   it('renders page title', () => {