ABSPATH is a PHP constant, which holds the Absolute path to the WordPress directory.
It is defined in wp-config.php
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
ABSPATH for Security
You can place it on top of a plugin or theme to prevent direct access to these files (from the URL):
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
Entrepreneur | Full-stack developer | Founder of MediSign Ltd. I have over 15 years of professional experience designing and developing web applications. I am also very experienced in managing (web) projects.