Title: hideWhenSubscribed variable not working
Last modified: June 29, 2022

---

# hideWhenSubscribed variable not working

 *  Resolved [angeloarlotta](https://wordpress.org/support/users/angeloarlotta/)
 * (@angeloarlotta)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/hidewhensubscribed-variable-not-working/)
 * Hi,
    I followed this documentation to add a custom button prompt: [https://documentation.onesignal.com/docs/web-push-custom-code-examples#section-custom-link-prompt](https://documentation.onesignal.com/docs/web-push-custom-code-examples#section-custom-link-prompt)
 * If I set this variable to true, the unsubscribe button is still visible:
 * var hideWhenSubscribed = true;
 * How can I disable the unsubscribe button when a user subscribes?
 * Thanks,
    Angelo

Viewing 1 replies (of 1 total)

 *  Plugin Author [OneSignal Push Notifications](https://wordpress.org/support/users/onesignal/)
 * (@onesignal)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/hidewhensubscribed-variable-not-working/#post-15807008)
 * Please contact our support team at [support@onesignal.com](https://wordpress.org/support/topic/hidewhensubscribed-variable-not-working/support@onesignal.com?output_format=md)
   and reference this wordpress forum url.
 * Include the site url with this code and our team will try to assist.
 * The example code on that page is for example and may not work with every website.
   You may want to hire a developer if you need custom code implementation.

Viewing 1 replies (of 1 total)

The topic ‘hideWhenSubscribed variable not working’ is closed to new replies.

 * ![](https://ps.w.org/onesignal-free-web-push-notifications/assets/icon.svg?rev
   =3003897)
 * [OneSignal - Web Push Notifications](https://wordpress.org/plugins/onesignal-free-web-push-notifications/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/onesignal-free-web-push-notifications/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/onesignal-free-web-push-notifications/)
 * [Active Topics](https://wordpress.org/support/plugin/onesignal-free-web-push-notifications/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/onesignal-free-web-push-notifications/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/onesignal-free-web-push-notifications/reviews/)

## Tags

 * [unsubscribe](https://wordpress.org/support/topic-tag/unsubscribe/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 1 reply
 * 2 participants
 * Last reply from: [OneSignal Push Notifications](https://wordpress.org/support/users/onesignal/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/hidewhensubscribed-variable-not-working/#post-15807008)
 * Status: resolved