Title: Add Block programmatically: What IP encoding method
Last modified: January 26, 2023

---

# Add Block programmatically: What IP encoding method

 *  Resolved [netstepinc](https://wordpress.org/support/users/netstepinc/)
 * (@netstepinc)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/add-block-programmatically-what-ip-encoding-method/)
 * I would like to add IPs to _wfblocks7 programmatically to provide an easy for
   for WC Shop Managers to block fraudsters.
   However, I can’t seem to get it encoded
   into the proper IPV6/HEX format.SPAMMER example:How do I convert 98.208.240.124
   to 00000000000000000000ffff62d0f07c so I can save it to the database.What method
   or function should I use?#paidWFcustomer

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

 *  Thread Starter [netstepinc](https://wordpress.org/support/users/netstepinc/)
 * (@netstepinc)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/add-block-programmatically-what-ip-encoding-method/#post-16412500)
 * If figured it out.
   IN = wfUtils::inet_pton($ip);OUT = wfUtils::inet_ntop($block-
   >IP)
 *  Thread Starter [netstepinc](https://wordpress.org/support/users/netstepinc/)
 * (@netstepinc)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/add-block-programmatically-what-ip-encoding-method/#post-16412504)
 * resolved

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

The topic ‘Add Block programmatically: What IP encoding method’ is closed to new
replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 2 replies
 * 1 participant
 * Last reply from: [netstepinc](https://wordpress.org/support/users/netstepinc/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/add-block-programmatically-what-ip-encoding-method/#post-16412504)
 * Status: resolved