Is storing IP adresses in database a safety hazard?

I am new to web developing and hosting so I know nothing about safety. What I want to have option for people visiting my site to add data to database.
But I want to prevent potential spamming and block those users from using this feature but I would need to store their IP address. Is this safe to do?

I don’t think it would be necessary to hash or encrypt the IP addresses you store. However, you have to keep in mind that changing your IP address is simple and can bypass your security measures.


Databases are design to be relatively secure places to store data. Virtually all dynamic websites use databases to store confidential data, such as PII and private information.

That said, while you could store IP addresses and block those, blocking spammers effectively with IP blocklists is very difficult because spammers use a large number of IP addresses and switch between them rapidly. In my experience, using a CAPTCHA system such as ReCaptcha, hCaptcha or Cloudflare Turnstile is much more effective at stopping spam.


Thanks a lot


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.