© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
3 replies
dannyh

Supabase best practices for sanitizing user-generated HTML in database?

I'm creating a site where the user uses a rich text editor that outputs HTML. The user then puts that in a database field every time they save it. I know I could sanitize it on the frontend, but that doesn't work if I want SEO.

Is there a way I could receive the incoming HTML on the client trying to
.insert()
.insert()
it into the database, get a Supabase function to sanitize the HTML, then have the HTML go into the database? I know I could add another column, something like
is-sanitized
is-sanitized
but that creates some more UX headaches.

Also, I know I can have a webhook, but that doesn't wait for a response (right?). If I go with that route, if there is an error with the webhook the unsanitized HTML would just say in the database. Ideally it never goes in at all.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Best practices for Supabase in the server
SupabaseSSupabase / help-and-questions
9mo ago
Database recovery and best practices
SupabaseSSupabase / help-and-questions
5mo ago
Best Practices for Agent Access in a Multi-Tenant Supabase Setup
SupabaseSSupabase / help-and-questions
2w ago
Best Practices for Client accessing Supabase via a server
SupabaseSSupabase / help-and-questions
7mo ago