• Resolved wpapm

    (@wpapm)


    Hi,

    How can I ensure that

    .../wp-content/plugins/contact-form-7-honeypot/includes/apps/cf7-redirection/assets/js/app.js?ver=3.4.0-1.0.0

    is not included on every page, but only on the contact pages?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support fahadwaheed

    (@fahadwaheed)

    Hi @wpapm

    I hope you are doing well.

    Thank you for contacting the CF7 Apps Support Team. We are happy to assist you.

    To help us better understand the issue and provide accurate guidance, we kindly request that you share screenshots (highlighted if possible) or a screen recording showing the complete issue.

    This information will enable us to investigate the matter thoroughly and assist you more effectively.

    We look forward to your response.

    Thread Starter wpapm

    (@wpapm)

    Hello and thank you for the feedback.

    On my website, which is currently being developed locally using Local WP, there are three pages that integrate the CF7 contact form.

    On these contact pages, the redirect function of your plugin is also used to redirect users after the form is submitted.

    However, due to the use of your plugin, the following is visible in the source code of all pages:

    <script id="cf7apps-redirection-js-extra">
    var cf7appsRedirection = {"ajaxurl":"http://test.local/wp-admin/admin-ajax.php"};
    //# sourceURL=cf7apps-redirection-js-extra
    </script>
    <script src="http://test.local/wp-content/plugins/contact-form-7-honeypot/includes/apps/cf7-redirection/assets/js/app.js?ver=3.4.0-1.0.0" id="cf7apps-redirection-js"></script>

    The code would probably only be really needed on the contact pages 😉

    Therefore, it would be nice if the code could simply be included on specific page IDs or via the template name. Perhaps this could be done by adding an entry to the theme’s functions.php file?

    If not… no problem. I just noticed that there’s code on pages where it’s not strictly necessary. Thanks for the plugin, too! Best regards

    Plugin Support fahadwaheed

    (@fahadwaheed)

    Hi @wpapm

    The redirect script is only needed on pages that have a Contact Form 7 form. By default, we load it on all pages to make sure redirects always work, because there’s no fully reliable way to detect CF7 forms on every page, especially when forms are added via shortcodes, page builders, widgets, or dynamic content.

    The script is very lightweight and only runs when a form is submitted, so it won’t affect other pages.

    Thread Starter wpapm

    (@wpapm)

    Hi @fahadwaheed

    Thank you for the clear answer.

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

You must be logged in to reply to this topic.