• Features
  • Pricing
  • Help
  • My Account
  • Buy Now
WP Ghost
  • Features
  • Pricing
  • Help
  • My Account
  • Buy Now

Customize WP Ghost Cookie Names | wp-config Guide

/Developers /Customize WP Ghost Cookie Names | wp-config Guide
Table of Contents
  • Why Customize Cookie Names?
  • Change the Cookie Name
  • Frequently Asked Questions
    • What should I name the cookie prefix?
    • What if I get locked out after changing the cookie name?
    • Where can I find all WP Ghost constants?
    • Does WP Ghost modify WordPress core files?
  • Related Tutorials

WP Ghost uses custom cookies for logged-in user sessions that work with custom admin paths. By default, these cookies use the hmwp_logged_in_ prefix. You can change this prefix to any custom value by adding the HMWP_LOGGED_IN_COOKIE constant to wp-config.php. This removes another WordPress-specific identifier from browser developer tools and cookie headers.

Why Customize Cookie Names?

Why customizing WP Ghost cookie names helps remove WordPress identifiers from browser sessions

WordPress sets cookies with recognizable names (like wordpress_logged_in_) that security scanners and browser developer tools can use to identify a WordPress site. WP Ghost replaces these with its own cookies, but the default hmwp_logged_in_ prefix can itself reveal that WP Ghost is installed. Changing the cookie prefix to a custom value (like my_session_ or app_auth_) removes this identifier, making it harder for anyone inspecting cookies to determine which CMS or security plugin you use.

Change the Cookie Name

  1. Open wp-config.php via FTP, cPanel File Manager, or SSH.
  2. Add the following line before the /* That's all, stop editing! Happy publishing. */ comment:
define('HMWP_LOGGED_IN_COOKIE', 'my_logged_in_');
  1. Replace 'my_logged_in_' with any prefix you prefer.
  2. Save the file.
  3. Go to WP Ghost > Change Paths and click Save to refresh the settings.
  4. Clear your browser cookies (or open an incognito window) and log in again for the new cookie name to take effect.
wp-config.php showing the HMWP_LOGGED_IN_COOKIE constant with a custom cookie prefix

You must clear cookies and log in again. Existing session cookies use the old prefix. The new cookie name only applies to new sessions. Clear your browser cookies or use an incognito window, then log in to create cookies with the new prefix.

Frequently Asked Questions

What should I name the cookie prefix?

Use any alphanumeric string with underscores. Avoid names that identify WordPress or WP Ghost (like wp_ or hmwp_). Generic names like app_session_, site_auth_, or your brand’s abbreviation work well. Keep it short.

What if I get locked out after changing the cookie name?

Clear your browser cookies and log in again. The new cookie name creates fresh session cookies on login. If you need to revert, remove the HMWP_LOGGED_IN_COOKIE line from wp-config.php and the default hmwp_logged_in_ prefix is restored. For emergency access, see the emergency disable guide.

Where can I find all WP Ghost constants?

See the WP Ghost Constants Reference for all available wp-config.php constants including priority loading, dynamic files, admin paths, permissions, and more.

Does WP Ghost modify WordPress core files?

No. The constant is added to wp-config.php, which is your site’s configuration file, not a WordPress core file. WP Ghost uses WordPress hooks for cookie management.

Related Tutorials

WordPress identity removal and configuration:

  • WP Ghost Constants Reference – All wp-config.php constants including HMWP_LOGGED_IN_COOKIE.
  • Change and Hide the wp-admin Path – Custom admin path that works with custom cookies.
  • Simulate Drupal or Joomla CMS – Change the generator tag alongside cookie customization.
  • Text and URL Mapping – Replace remaining WordPress identifiers in page source.
Tagged: hmwp_logged_in_adminhmwp_logged_in_logincustomize wp ghost cookiescookies

Related Articles

  • Stop WP Ghost Auto Update Check | wp-config.php

  • Add a Custom CMS Simulator in WP Ghost

  • WP Ghost Constants in wp-config.php

  • Change Paths in WordPress Admin Dashboard

  • Add Files to Hide WordPress Common Files

  • Change or Remove WordPress Login Logo Link

WP Ghost 9.0

WP Ghost 9.0 is the most significant release since the plugin was renamed from Hide My WP Ghost. This update introduces a redesigned security dashboard with a real-time Security Optimization Score, a customizable login page designer, Copyright protection from AI Crawlers, interactive threat geography mapping, and more.

Wp Ghost 9

WP Ghost - Best Practice

Learn how to set up WP Ghost in Ghost Mode and activate all the security features you need for a stronger and safer website.

Most Popular

  • How to Change the admin-ajax.php Path in WordPress
  • WP Ghost Compatible Plugins and Themes List
  • What is WP Ghost?
  • Lesson 3 – Hide Your Site from WordPress Theme Detectors and Bots
  • How to Change and Hide wp-admin Path in WordPress
  • WP Ghost Settings – Best Practice
  • Install WP Ghost Free Plugin for WordPress
  • Lesson 1 – Customize Paths and Hide Your WordPress Website
  • Setup WP Ghost on Nginx Server Guide
  • WordPress Security Check – 40 Security Tasks
  • Theme Not Loading Correctly and Website Loads Slower
  • How to Configure WP Ghost Firewall Protection
  • WP Ghost Compatible WordPress Themes List
  • WP Ghost – Changelog
  • Set AllowOverride All on Apache Servers Step by Step
  • How To Change WordPress File Permissions for Security
  • WordPress Brute Force Protection with reCAPTCHA
  • How to Change the Plugins Path in WordPress
  • Change Paths in WordPress Admin Dashboard
  • Activate WordPress Debugging | WP Ghost Guide
  • Two-Factor Authentication (2FA) for WordPress
  • How to Change and Hide wp-login Path in WordPress
  • How to Change Paths in Cached Files with WP Ghost
  • How to Change the REST API Path and Disable XML-RPC
  • Disable WP Ghost In Case Of Error
  • How to Configure Redirects in WP Ghost
  • How to Change the Registration Path in WordPress
  • Hide wp-admin and wp-login.php from Source Code
  • Add Brute Force Protection to Elementor Login Forms
  • Hide WordPress from Wappalyzer | WP Ghost Guide

Product

  • What is WP Ghost?
  • Free vs Premium
  • Pricing
  • Changelog
  • Why WP Ghost
  • Knowledge Base

Features

  • Path Security
  • Firewall Security
  • Brute Force Protection
  • Two-Factor Authentication
  • User Events Log
  • Security Threats Log

Resources

  • Getting Started Guide
  • Plugin Compatibility
  • Theme Compatibility
  • Hosting Setup Guides
  • Developer Hooks
  • FAQs

Company

  • Affiliate
  • Media Kit
  • Terms Of Use
  • Privacy Policy
  • GDPR Compliance
  • Contact
  • Facebook
  • YouTube
  • X
© WP Ghost 2016-2026 | Powered by AISQ | Squirrly