How to Prevent Google Analytics from Tracking WordPress Page Views
- Sign in to Google Analytics and click Admin in the top navigation.
- Make sure the two drop-downs on the left are set to the appropriate Account and Property for your site.
- In the View dropdown, select Create new view. Give it a meaningful name like “Filter testing,” and set your timezone settings as necessary.
- Finally, click Create View.
Once you’ve got your new view created, return to the Admin screen and ensure that your test view is selected in the far right column. Now we’ll create the filter to remove preview pages:
- Click Filters in the View column, and then click the +NEW FILTER button.
- Give your filter a meaningful name like “Exclude Preview Traffic.”
- For Filter Type, select the Custom filter radio button.
- Leave the next radio button on Exclude, which should be the default choice.
- In the Filter Field drop-down menu, select Request URI.
- In the Filter Pattern text field, enter preview=true
(The reason we are entering this text is that it is included in the address of every single WordPress preview page!)
- Click Save.