Exit Site Button

If your nonprofit would like to have an ‘Exit Website’ button, you’ll need to use a plugin, and a short piece of code to make it happen.

Activate the “Exit WordPress” plugin

Add this code snippet through the Customizer
Customizer -> Code -> Javascript

// Wait until the page is loaded before executing javascript...
jQuery(document).ready(function ($) {
  
  var button = $('.your-button-selector');
  
  // Bind a click event callback to your button.
  button.on('click', function () {
    
    // Do something when the button is clicked, ie, go to google.
    window.location.href = 'https://google.com'
  });
});

Was this article helpful?

Related Articles

Need more help?

If volunteering during an event, use #help-support in Slack. Otherwise submit a support ticket.
Support Ticket