• I had a lot of attacks from certain IPs and was recommended to restrict access to admin by only allowing our IP in the admin htaccess file. However this had a really strange side effect that I cannot explain. All our site online forms (Ninja Forms), stopped submitting. The send button spinner would just spin. Not send. I have no idea why the admin htaccess could affect this. I removed the code and the forms started working again. As I would like to limit admin access, please help me understand what happened. The code is below.

    order deny,allow
    allow from [our IP address]
    deny from all

Viewing 3 replies - 1 through 3 (of 3 total)
  • @not1_name – I would suggest pinging the Ninja Forms support team via the plugins forums or directly (https://wordpress.org/support/topic/get-better-faster-help-here/) although as is, I suspect the plugin is calling to functions it needs to complete its processes in the “admin” side of your site and your .htaccess code is blocking it (likely as these processes are getting owned by the server’s IP address and not yours).

    You might also consider blocking the offending IP addresses (and, yes, this can become a very extensive and hard to manage list in some cases) rather than allowing your IP address only.

    ~Cais.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    When you restricted access to the wp-admin, you forgot that some things, like form submission, still go through that. Specifically, you need to allow access to admin-ajax.php and admin-post.php for plugins that use those to be able to work.

    <Files admin-ajax.php>
        Order allow,deny
        Allow from all
        Satisfy any
    </Files>
    

    And so on.

    Thread Starter not1_name

    (@not1_name)

    In case anyone finds this thread, I have posted Ninja forms reply. They do use a file in the admin folder to submit forms. So if you lock down your admin files to prevent attack, you will break the form submission.

    “Ninja Forms uses admin-ajax.php to handle the submission go the form data”

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

The topic ‘admin restrictions affecting forms’ is closed to new replies.