The message “Constant WP_USE_THEMES already defined in …/index.php” comes from the index.php file in the root of your WordPress install, not from GeoDirectory or your theme. That file sets the WP_USE_THEMES constant and loads WordPress. PHP complains when the constant is defined a second time, which means the file has been changed or something is loading it twice.
How to fix it
- Back up your site files.
- Open index.php in the WordPress root folder (the folder that holds wp-config.php). An unchanged copy is only a few lines long and looks like the example below.
- If you see
define( 'WP_USE_THEMES', true );twice, or extra code above or below it, replace the file with the index.php from a fresh download of your WordPress version. - If the file looks normal, something else is loading it: a security, caching or maintenance plugin, or a custom setup on your host. Deactivate plugins one at a time until the notice goes, and ask your host if the file keeps changing.
<?php
/**
* Front to the WordPress application.
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
An index.php that changes when nobody edited it can be a sign the site has been hacked. If that happens, run a malware scan and talk to your host.
Hide notices from visitors
Live sites shouldn’t print PHP notices on the page. In wp-config.php, either turn debugging off or keep logging but stop the display:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
This hides the message but doesn’t remove the cause, so still fix index.php.