Close (X) should redirect to another URL in PopUP pro


Where can I update the code so that when (X) is pressed would lead to another URL insted of #?

Please let me know the file which I need to update.



  • Vaughan
    • Support/SLS MockingJay

    Hi Barun,

    Welcome to wpmudev, hope you’re well?

    I’ve been looking through the code, but I can’t seem to find where you can set this, I believe it’s in the JS file public.js however, I don’t see any redirect code, it just changes the CSS class to close it, MY JS isn’t too great, but I will ask one of our developers to see if he can help with this for you.

    Hope this helps

  • Barun
    • New Recruit


    You have click function available for other properties, such as; background_click. Why not to create one for the button_close?

    Could you please make it quick because we have to redirect our viewers to other website? It’s really important. Must be done ASAP.


    – Barun

  • Vinod Dalvi
    • WP Unicorn

    Hi Barun,

    Thank you for your reply.

    To achieve this try adding the following code in the functions.php file of your child theme or add it in your site using the following plugin.

    function custom_js(){ ?>
    <script type="text/javascript">
    jQuery( window ).load(function(){

    window.location.href=''; // Change the site URL here.
    return false;
    <?php }
    add_action('wp_head', "custom_js", 999);

    Change the URL in the above code where you want to redirect users on clicking close button of pop up.

    Best Regards,

    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.