• 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

Stop WordPress hacks before they start

Path security, 8G firewall, brute force protection, and passkeys. 60-second setup.

Install Free → See Premium Plans
Last 30 days
100M+ threats blocked
Across 250,000+ protected sites.
Read the Impact Report →
Rated by real users
★ 4.5
WordPress.org
★ 4.8
G2
★ 4.8
Capterra
★ 4.8
AppSumo
Getting Started
  • What is WP Ghost?
  • Install WP Ghost (Free)
  • 3-Minute Safe Mode Setup
  • Best Practice Settings Guide
  • One-Click Security Presets
  • Website Security Check
Path Security
  • Hide wp-admin Path
  • Hide wp-login Path
  • Change wp-content Path
  • Change Plugins Path
  • Hide Author ID & Path
  • Change REST API Path
  • Change admin-ajax.php Path
Login & 2FA
  • Two-Factor Authentication (2FA)
  • Passkey 2FA (Face ID, Touch ID)
  • Magic Link Login
  • Temporary Logins
  • Brute Force Protection + reCAPTCHA
  • Login Page Designer
Firewall & Monitoring
  • 7G & 8G Firewall
  • Security Headers (HSTS, CSP)
  • Security Threats Log
  • User Events Log
  • Country Blocking (Geo)
  • Disable XML-RPC Access
Hardening
  • Hide Your WordPress Website
  • Hide from Theme Detectors
  • Hide Common WordPress Files
  • Prevent Hack Attacks on WordPress
  • Hacker Bot Attack Types
Compatibility
  • Plugin Compatibility List
  • Theme Compatibility List
  • WooCommerce Setup
  • Nginx Server Setup
  • Hosting Setup Guides
  • Emergency: Disable WP Ghost
Help & Resources
  • Full Knowledge Base
  • Frequently Asked Questions
  • Changelog
  • Developer Hooks Reference
  • Contact Support
Free vs Premium?

Lite Mode (Free) covers core path security. Safe Mode and Ghost Mode (Premium) add advanced features.

Compare Plans →

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
  • Impact Report

Company

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