0

So far, when I was using Wordpress as Headless CMS, I've always constructed my API with GraphQL or by simply add customs REST endpoints but recently after an SEO audit, the armageddon has come.

I'll skip details but basically, content is duplicated everywhere and front-end remains accessible for visitors.

So I was asking myself, what is the best way to fully disabled the front-end generated by Wordpress?

1
  • Is the frontend of your WP not the headless CMS? I'm not sure why you've made the frontend of your WP reachable, this should have been disabled at the server level before WP or PHP was involved, aka Apache/Nginx or even at the CDN level
    – Tom J Nowell
    Commented Nov 15, 2022 at 17:28

1 Answer 1

0

Edit the constant WP_USE_THEMES in index.php to false, to avoid loading any theme as part of the Wordpress loop sequence.

 define( 'WP_USE_THEMES', false); 

Reference: https://github.com/WordPress/WordPress/blob/master/index.php#L14

See also: https://codex.wordpress.org/The_Loop#Using_The_Loop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.