Is it possible? I have a situation where a client needs the production site to be completely shut down and void of content updates. They do all of their content management on a staging site, then publish the database when changes are approved.

3 Answers 3


Good call Brad! Not sure why that didn't occur to me :)

Here's how that's done:

# Kill admin access
RewriteCond %{REQUEST_URI} ^(.*)/admin
RewriteRule ^(.*)$ - [F,L]

Nothing native in Craft that would do this, but I suppose you'd be able to .htaccess redirect all requests to your cpTrigger.

  • You could also just change to cpTrigger to something really obscure and not share that with the client. At least then you'd be able to access to admin panel in production yourself, if you needed to. The client would just get a 404 since the cpTrigger in production would not be what they were used to. Jul 10, 2019 at 16:42

The best way to do this (in my opinion) is to disable access to the CP from the user's permission panel.

  • This is partially-valid, in that it will work to revoke access, but I think the question is more about how to completely remove the possibility of admin access and mutations via the admin in one environment. I'd assume the project is using User Groups to define permissions, which means that the asker would have to define separate Groups and/or permissions for each environment—or manually grant/revoke access in the database (which in itself is likely not a viable solution, as it sounds like they're synchronizing the database up from a place where the admin is accessible). Dec 6, 2019 at 0:37
  • Good points, it does seem likely the user groups are already set up though. Dec 6, 2019 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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