Title: Customize error code 503 for locked out users
Last modified: February 8, 2024

---

# Customize error code 503 for locked out users

 *  Resolved [isradlt](https://wordpress.org/support/users/isradlt/)
 * (@isradlt)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/customize-error-code-503-for-locked-out-users/)
 * Hi there,
 * I currently have a few WordPress sites hosted on AWS Beanstalk environments and
   use Wordfence as a WAF in all of these sites. We have enabled the option to block
   IP addresses that try to log in more than 10 times with wrong credentials and
   this throws out 503 error codes to the visitors. I think this is the expected
   behavior, but the problem is that every time our webserver gets a 500 error, 
   our Beanstalk treats this as a faulty web server and shows a warning in AWS console.
   This is just a warning but it’s a bit annoying to have this warning from time
   to time.
 * Wordfence live traffic with 503 error codes:
   [https://ibb.co/PcFY97r](https://ibb.co/PcFY97r)
   AWS Beanstalk complaining about these 50x errors:[https://ibb.co/bKPJZW4](https://ibb.co/bKPJZW4)
 * I was looking at the Wordfence plugin code and I think I found how to customize
   this error code to something more useful in our case, like 403 or 404 errors,
   in these files:
 * vendor/wordfence/wf-waf/src/lib/waf.php
   vendor/wordfence/wf-waf/src/lib/utils.
   phpBut I don’t know if there is another way to customize this code and make it
   persistent if we update Wordfence to newer versions, or if this is a feature 
   I should request.
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [wfpeter](https://wordpress.org/support/users/wfpeter/)
 * (@wfpeter)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/customize-error-code-503-for-locked-out-users/#post-17412237)
 * Hi [@isradlt](https://wordpress.org/support/users/isradlt/), thanks for highlighting
   your use-case.
 * We do have a case open to migrate our HTTP 503 response codes to 429 for temporary
   blocks/rate limiting and 403 for permanent. Due to the ever-shifting nature of
   priorities when it comes to threat detection, I’m never able to give release 
   dates or updates on development here on the forum, but have passed your additional
   request to the team.
 * We’re unable to support custom code changes to the plugin, although it’s important
   to note that any changes you do choose to make may be broken or reverted with
   future plugin updates.
 * Thanks,
   Peter.
 *  [p15h](https://wordpress.org/support/users/prestonwordsworth/)
 * (@prestonwordsworth)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/customize-error-code-503-for-locked-out-users/#post-17923618)
 * [@wfpeter](https://wordpress.org/support/users/wfpeter/), good to hear you have
   plans to migrate to the semantically more appropriate 429 for rate limiting. 
   That’d be a most welcome improvement!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Customize error code 503 for locked out users’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [503 error](https://wordpress.org/support/topic-tag/503-error/)

 * 2 replies
 * 3 participants
 * Last reply from: [p15h](https://wordpress.org/support/users/prestonwordsworth/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/customize-error-code-503-for-locked-out-users/#post-17923618)
 * Status: resolved