{"id":2752,"date":"2026-10-20T08:36:22","date_gmt":"2026-10-20T07:36:22","guid":{"rendered":"https:\/\/wpgeodirectory.com\/documentation\/article\/constant-wp-use-themes-already-defined\/"},"modified":"2026-10-20T08:39:01","modified_gmt":"2026-10-20T07:39:01","slug":"constant-wp-use-themes-already-defined","status":"publish","type":"gd_place","link":"https:\/\/wpgeodirectory.com\/documentation\/article\/troubleshooting\/constant-wp-use-themes-already-defined\/","title":{"rendered":"Notice: Constant WP_USE_THEMES already defined"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The message &#8220;Constant WP_USE_THEMES already defined in &#8230;\/index.php&#8221; comes from the index.php file in the root of your WordPress install, not from GeoDirectory or your theme. That file sets the <code>WP_USE_THEMES<\/code> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to fix it<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Back up your site files.<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>If you see <code>define( &#039;WP_USE_THEMES&#039;, true );<\/code> twice, or extra code above or below it, replace the file with the index.php from a fresh download of your WordPress version.<\/li>\n\n\n\n<li>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.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">&lt;?php\n\/**\n * Front to the WordPress application.\n *\/\ndefine( &#039;WP_USE_THEMES&#039;, true );\n\n\/** Loads the WordPress Environment and Template *\/\nrequire __DIR__ . &#039;\/wp-blog-header.php&#039;;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hide notices from visitors<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Live sites shouldn&#8217;t print PHP notices on the page. In wp-config.php, either turn debugging off or keep logging but stop the display:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">define( &#039;WP_DEBUG&#039;, true );\ndefine( &#039;WP_DEBUG_LOG&#039;, true );\ndefine( &#039;WP_DEBUG_DISPLAY&#039;, false );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This hides the message but doesn&#8217;t remove the cause, so still fix index.php.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The message &#8220;Constant WP_USE_THEMES already defined in &#8230;\/index.php&#8221; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[211,437],"class_list":["post-2752","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-tips-tricks-more","gd_placecategory-troubleshooting"],"_links":{"self":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/comments?post=2752"}],"version-history":[{"count":1,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2752\/revisions"}],"predecessor-version":[{"id":2862,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/2752\/revisions\/2862"}],"wp:attachment":[{"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/media?parent=2752"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/tags?post=2752"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/wpgeodirectory.com\/documentation\/wp-json\/wp\/v2\/article\/categories?post=2752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}