---
title: "How to Disable View Page Source in WordPress?"
url: https://nexterwp.com/docs/disable-view-page-source-in-wordpress/
date: 2023-02-24
modified: 2026-05-01
author: "Aditya Sharma"
description: "Page source code reveals more than just your site's content. It can expose your WordPress version, theme name, and custom scripts, all of which can be used to identify and..."
image: https://nexterwp.com/wp-content/uploads/2024/05/disable-view-page-source-in-wordpress-1024x519.jpg
word_count: 311
---

# How to Disable View Page Source in WordPress?

## Key Takeaways

- Nexter Extension Content Protection disables the Ctrl+U and CMD+U keyboard shortcuts that open page source in a browser.
- Page source can expose a WordPress version, theme name, and custom scripts, which can help identify and exploit site vulnerabilities.
- Disable Ctrl+U/CMD+U does not block the browser's right-click menu, so the post says to use Disable Right Click alongside it; it also mentions disabling Inspect Element (F12).

Page source code reveals more than just your site's content. It can expose your WordPress version, theme name, and custom scripts, all of which can be used to identify and exploit site vulnerabilities. Disabling the View Page Source hotkey reduces the information a visitor can gather from your site's front end.

With the [Nexter Extension](https://nexterwp.com/help/nexter-extension/) Content Protection feature, you can disable the Ctrl+U and CMD+U keyboard shortcuts that open the page source in a browser.

To check the complete feature overview documentation of the Content Protection feature, [click here](/docs/content-protection-for-wordpress-overview/).

**Best Used For:**

- Membership sites protecting exclusive content and layout details from easy access- Business sites hiding WordPress version and theme information from competitors- Agencies securing client site builds during active development

Requirement: This feature is a part of [Nexter Extension](https://nexterwp.com/help/nexter-extension/), make sure it is installed and activated.

To disable View Page Source in WordPress, follow the steps below:

1. Go to **Nexter → Extensions → Security** in your WordPress dashboard.

2. In the **Content Protection** section, enable the main toggle to activate content protection.

3. Click the gear icon (⚙) next to Content Protection to open the settings popup.

![](https://nexterwp.com/wp-content/uploads/2023/02/enable-content-protection-new-1024x511.png)

4. In the popup, go to the **Protections** tab and turn on the **Disable Ctrl+U/CMD+U** toggle.

5. In the **Who Can Access** section, select any user roles to exclude from this restriction. Use this when your site has administrators or developers who need to inspect page source for debugging.

6. Click **Save**.

![disable page source](https://nexterwp.com/wp-content/uploads/2023/02/disable-page-source-new.png)

> **Note:** Disabling the Ctrl+U/CMD+U shortcut does not prevent access to source code through the browser's right-click menu. Use the [Disable Right Click](https://nexterwp.com/docs/prevent-text-copy-in-wordpress/) option alongside this setting to cover that access path as well.

You can also [disable browser Inspect Element (F12)](https://nexterwp.com/docs/disable-browser-inspect-element-on-wordpress-website/) to prevent visitors from opening developer tools from your site's front end.

For a more complete WordPress security setup, consider [enabling Two-Factor Authentication](https://nexterwp.com/docs/add-two-factor-authentication-in-wordpress/) to protect your admin login against unauthorized access.