• Resolved huubl

    (@huubl)


    Hi,

    Is there a PHP function to add IPs to Wordfence block list? And a function to get all blocked IPs?

Viewing 1 replies (of 1 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @huubl, thanks for your question.

    The Wordfence API currently only lets you add IP addresses to the allowlist with code. The reason the plugin doesn’t have the inbuilt ability to import IP addresses to the blocklist is because Wordfence references extensive IP blocklists that our team check and maintain so that our customers don’t need to employ a similar time-consuming strategy themselves. IPs that may appear appropriate for blocking won’t necessarily be that way forever.

    If you do wish to import some yourself, the IP addresses are stored at the wfblocks7 table in?IPv4-mapped IPv6 format. Within MySQL, you can get the right format using?inet6_aton()?like:?inet6_aton('::ffff:127.0.0.1'). The?::ffff:?is what allows IPv4 addresses to be stored in the same table as IPv6 addresses.

    Many thanks,
    Peter.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.