On this page
What this issue is
A card number, also called a PAN (primary account number), should only ever travel from the customer's browser to your payment provider. If the full number shows up anywhere else, you have this issue. Common places are: the page URL (?card=4242...), web server access logs that record that URL, application or error logs that dump the request body, browser history and referrer headers, and analytics or ad tracking requests.
Why it costs you leads or sales
Leaked card data is a security incident, not just a tidy-up job. It can bring card-brand fines, a forced audit, higher processing fees or the loss of your merchant account. Customers whose cards are exposed may be hit by fraud and stop buying from you.
- Customer types cardForm on your own page
- Sent in URL (GET)?card=4242...
- Server and CDN logsPAN stored in plain text
- Analytics and ad tagsPage URL sent to third parties
The leak starts at the form and spreads to every system that records the URL or request.
How to check if your site has it
Use a test card in your checkout
Only in your payment provider's test mode, enter a documented test number such as 4242 4242 4242 4242. Never use a real card.
Watch the address bar and Network tab
Open browser DevTools, go to Network, and submit. Check every request URL for the number or its digits. Look at query strings and redirects.
Search your logs
Search access and application logs for the test number and for any 13 to 19 digit sequence.
Check analytics
In GA4 DebugView or your tag manager's preview mode, inspect the page_location and any custom parameters for card digits.
grep -rn "4242424242424242" /var/log/nginx/ /var/log/apache2/ 2>/dev/null
grep -rEn "[0-9]{13,19}" /var/log/nginx/access.log | headHow to fix it
Stop card entry on your own page
Use your payment provider's hosted fields or hosted checkout so the number goes straight to them and never touches your server.
Use POST, never GET, for sensitive forms
A form with method="get" puts every field in the URL. Change it to method="post" or remove card fields from your form.
Turn off request-body debug logging
Disable verbose logging of payloads on checkout routes and in any plugins.
Mask or drop data in logs and tags
Add a masking rule so digit sequences are redacted, and stop tags from reading form fields.
Purge existing copies
Securely delete or redact old logs, backups and analytics data that contain card numbers. Ask your host and analytics provider how, and tell your payment provider if real cards were exposed.
Check payment plugins
Use a gateway plugin that uses hosted fields or redirects to the provider. Avoid plugins that post raw card fields to your server.
Disable debug logging
Set WP_DEBUG_LOG to false and turn off the gateway plugin's debug or log option under its settings (for WooCommerce, WooCommerce > Status > Logs).
Use Shopify Payments or a hosted gateway
Shopify's checkout handles card entry. Do not add custom card fields to theme pages.
Audit theme and apps
Check theme code and installed apps for scripts that read form inputs and send them to third parties.
Review variables and tags
Check for Auto-Event or custom JavaScript variables that read form fields, and for tags that send Page URL on checkout pages.
Redact digits
Use a custom JavaScript variable to strip digit runs from the URL before it is sent (code below).
Keep card fields out of native forms
Webflow forms are not for card data. Use an embedded hosted checkout from your provider.
Add log masking
Redact digit runs in your logging layer, and use the provider's tokenisation so your code only sees a token.
Nginx log format
Avoid logging query strings on checkout routes, using $uri instead of $request_uri in a dedicated log_format.
function() {
return {{Page URL}}.replace(/\d{13,19}/g, '[redacted]');
}log_format nocard '$remote_addr [$time_local] "$request_method $uri" $status $body_bytes_sent';
location /checkout {
access_log /var/log/nginx/checkout.log nocard;
}Leaking
- Card field posted with GET
- PAN stored in access logs
- Full URL sent to analytics
Fixed
- Hosted field sends card to the provider
- Logs hold no digits
- Tags receive a redacted URL
How to confirm it's fixed
- A test purchase in test mode shows no card digits in any URL in DevTools
- Searching fresh logs for the test number returns nothing
- Old logs and backups containing PANs are deleted or redacted
- Analytics DebugView shows clean page_location values
- Tag manager preview shows no tag reading card fields
- Your payment provider has been told if real cards were exposed
How to prevent it happening again
- Use hosted fields or hosted checkout only
- Review every new plugin, app or tag that touches checkout pages
- Keep debug logging off in production
- Run a scheduled log search for 13 to 19 digit sequences
- Set log retention limits
- Re-test checkout after each theme, plugin or tag change
How FunnelGuard handles this
FunnelGuard detects this issue only partly. Its check (no_pii_in_tracking) looks at the tracking hits the robot visitor sends to ad and analytics platforms while it runs your journey, and flags personal data that appears in them. That can catch a card-like value or other sensitive data travelling in a tracking request.
Questions people ask
Why are card numbers showing up in my URL?
Usually the form uses method="get", so every field is appended to the URL. It can also come from a redirect that passes form values along. Switch to POST and use your payment provider's hosted fields so the card never reaches your page.
Is it against PCI-DSS to have card numbers in server logs?
Generally yes unless the PAN is rendered unreadable, and the security code must never be stored after authorisation. Logs are a common place for accidental storage. Check with your payment provider or assessor for your exact obligations.
How do I find credit card numbers in my log files?
Search for known test numbers and for 13 to 19 digit sequences using grep or your log tool. Expect false positives such as timestamps and order IDs, so review matches carefully. Never copy real numbers into tickets.
How do I remove card numbers from old logs?
Securely delete or redact the affected files and any backups, and ask your host or log service how to purge them. Fix the source first so new data is not written. If real cards were exposed, inform your payment provider.
Can card numbers leak into Google Analytics?
Yes, if the number is in the page URL or a tag reads form fields, it can be sent as page_location or a custom parameter. Redact URLs in your tag manager and stop tags reading checkout inputs.
Does using Stripe or PayPal fix this?
Hosted fields and hosted checkouts keep the card number off your server, which removes the main source. You still need to check logs, tags and custom code so nothing else captures card data.
Can FunnelGuard find card numbers in my logs?
No. FunnelGuard checks tracking hits for personal data during its journey runs but does not read server logs. You need to search logs yourself.
Related issues
- OPS-365PCI-DSS 4.0 script inventory missing on payment pages (6.4.3)Fix guide
- OPS-366No tamper detection on payment page (11.6.1)Fix guide
- OPS-367Card data entered on own page instead of hosted fieldFix guide
- OPS-368Payment iframe served over insecure pageFix guide
- OPS-370Strong Customer Authentication (3DS) failingFix guide