Skip to main content
Adzbyte Solutions
Web Development

Edit Contact Cards Without Changing Shared Links

Adrian Saycon
Adrian Saycon
November 27, 20265 min read
Edit Contact Cards Without Changing Shared Links

A contact card has two things people tend to treat as one: the details inside it and the address used to share it. Changing a phone number shouldn’t require changing every place that already links to the card.

In recent client plugin work, contact cards became editable records in WordPress. Each record stores its content alongside a public path, an optional short path and a published state. That separation is the useful part. The examples here leave out the client’s names and contact details.

Keep the card identity separate from its addresses

The registry gives each card an internal identifier. Its label, card body, filename, public path and short path are separate fields. An editor can replace the contents while keeping the addresses that have already been shared.

Both public paths eventually serve the same saved card after the response changes. There’s no second copy of the contact information to update for the short address. The short link is another way to reach the record, not a separately maintained contact file.

That doesn’t make addresses permanently unchangeable. The editor still exposes them, so the person making changes needs to understand which fields affect existing links. In a larger system, I’d consider a warning or a migration path before allowing a widely shared address to change. That would be additional work, not a feature proved by this change.

Make the maintenance screen easy to find

The admin integration chooses one location for the card screen. It uses the site’s existing settings area when available, another installed tools menu as a fallback, and ordinary WordPress settings otherwise. The precedence keeps the same screen from being registered twice when both integrations exist.

The list shows the label, a contact summary, public link, short link and status. A later change adds explicit Edit and Delete actions. Those controls matter because a label that happens to be clickable isn’t always an obvious maintenance path.

The editor accepts a .vcf upload or pasted card text. A new upload replaces the text body. It also shows the current filename and makes the published state explicit. That gives the administrator a way to update or disable a card without editing plugin source files.

Validate the routes before saving them

A short-link field is a routing feature, so it needs more than generic text sanitization. The registry rejects traversal-like paths, duplicate assignments and reserved short paths. It also avoids claiming the existing contact-page address.

The duplicate check compares a proposed public path with other public and short paths, and does the same for the proposed short path. Checking only short paths against short paths would miss a collision across the two address types.

The tests include a duplicate short-link case and rejection of the reserved contact path. They also check that disabled cards aren’t matched. These are useful rules to keep near the registry, where both saving and public lookup can use the same meaning.

For an extension of this feature, I’d also inventory the site’s other custom routes before adding new reserved names. A registry can protect the routes it knows about without proving that every possible plugin route has been considered.

Use modest validation and describe it honestly

The upload helper checks the extension, a bounded content size and basic card framing. The normalizer removes a leading byte-order mark, handles line endings and produces CRLF output. Normalizing a previously normalized card is covered by a test.

Those checks are useful, but they aren’t a complete parser for every vCard property and version. The admin summary is also a small extraction of name, organization and phone fields. Don’t describe it as a full contact-format validator or assume every valid complex card will produce the perfect summary.

The editor keeps rejected form values briefly in a per-user transient before redirecting back. That helps with correcting input, but it’s best-effort convenience. A short-lived cache entry shouldn’t be presented as durable draft storage.

Protect changes where they happen

The save and delete handlers check the management capability and verify their action nonce. The menu’s visibility isn’t the permission check. A caller can submit directly to a handler, so the handler needs its own decision.

WordPress’s nonce documentation is clear that nonces don’t provide authorization by themselves. Keep the capability check even when the form includes a valid nonce, and escape the stored values for the HTML context where they’re shown.

The current registry lives in one site option and is bounded to a small number of cards. That’s a manageable design for this feature. It doesn’t claim versioned concurrent editing or a transactional record history. If several administrators begin editing at once, review that requirement instead of assuming an options array already solves it.

Verify the address after editing the content

A useful acceptance check saves a changed card without changing either public address, then requests both addresses and verifies the new body. Disable the card and check lookup behavior again. Test deletion separately, since removing a record changes what an existing shared link can do.

Also explain the limit to the person maintaining it: updating the server’s card changes future downloads. It doesn’t automatically rewrite a contact that someone already imported into their phone.

The change makes a small public asset maintainable through the admin interface. Keep that benefit tied to the actual behavior: one editable record, deliberate shared addresses and checks that prevent the registry from taking over a route it shouldn’t own.

Adrian Saycon

Written by

Adrian Saycon

A developer with a passion for emerging technologies, Adrian Saycon focuses on transforming the latest tech trends into great, functional products.

Discussion (0)

Your email is used only for comment moderation and is never published.

No comments yet. Be the first to share your thoughts.