---
title: "Disabling PageSpeed"
date: "2015-04-27"
category: "ruby"
slug: "disabling-pagespeed"
---

## Overview

In rare situations, PageSpeed may interfere with debugging on a staging site or conflict with custom JavaScript that manipulates the DOM in a `<head>` tag. Although disabling PageSpeed is usually unnecessary, you can do so with a simple [[htaccess-guide]] directive.

## How to Disable

1. Create or edit the `.htaccess` file in the [[where-is-site-content-served-from]] of the affected site.
2. Add the following line: `ModPagespeed off`

## Recommended Alternative

Disabling PageSpeed entirely will also disable automatic [[linking-google-analytics-to-apnscp]]. Instead, consider disabling only the specific [[pagespeed-support]] causing the conflict. For example, to disable CSS rewriting:

`ModPagespeedDisableFilters rewrite_css`
