# Staging a new community: Basic Auth breaks WP-Discourse plugin

**URL:** <https://meta.discourse.org/t/staging-a-new-community-basic-auth-breaks-wp-discourse-plugin/352368>\
**Category:** WordPress\
**Created:** [February 14, 2025, 8:13pm UTC](https://meta.discourse.org/t/staging-a-new-community-basic-auth-breaks-wp-discourse-plugin/352368 "2025-02-14T20:13:37Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Todd\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/todd_s/32/484575_2.png) [@Todd\_S](https://meta.discourse.org/u/Todd_S)\
**Post date:** [February 14, 2025, 8:13pm UTC](https://meta.discourse.org/t/staging-a-new-community-basic-auth-breaks-wp-discourse-plugin/352368/1 "2025-02-14T20:13:37Z")

</div>

I am staging Wordpress and Discourse sites (self-hosted) using the WP-Discourse plug-in.

I have successfully enabled HTTP Basic Authentication on both sites to keep them from being accessible until they are ready to go public (effectively blocking access from the general public as well as search engines).

**Wordpress (informational for folks looking to accomplish something similar)**

- Created `.htpasswd` file with a user and corresponding password
- Added authentication section to `.htaccess`
- Example how-to article: [https://help.dreamhost.com/hc/en-us/articles/216363187-Password-protecting-your-site-with-an-htaccess-file](https://help.dreamhost.com/hc/en-us/articles/216363187-Password-protecting-your-site-with-an-htaccess-file)

**Discourse**

- Followed these steps to modify `app.yml`: [Restrict access to your Discourse site with HTTP Basic Authentication](https://meta.discourse.org/t/restrict-access-to-your-discourse-site-with-http-basic-authentication/168192)
- Rebuild configuration: `/var/discourse# ./launcher rebuild app`

The WP-Discourse plugin works well until basic authentication is enabled on the Discourse server.

(Edit) This is the error in the WP-Discourse plugin log on the Wordpress end: `[2025-02-14 18:20:06] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":401,"http_body":"<html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body>\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n"}`

Any thoughts on how to exclude APIs from requiring HTTP Basic Authentication on Discourse?

Thanks!

---

_[View the full topic](https://meta.discourse.org/t/staging-a-new-community-basic-auth-breaks-wp-discourse-plugin/352368)._
