Dynamic Contact Info Blocks

Description

Dynamic Contact Info Blocks is a WordPress plugin that helps you effortlessly manage your business contact details including phone numbers, emails, addresses, and custom fields. It provides an easy way to update and display this information throughout your WordPress site using shortcode-like placeholders.

Features

  • Easy management of contact information through WordPress admin interface
  • Support for basic contact fields (phone, email, address)
  • Custom fields support for additional information
  • Clipboard copy functionality for easy placeholder copying
  • Responsive admin interface
  • Clean and organized code structure following WordPress Plugin Boilerplate standards
  • Elementor integration: Works seamlessly with Elementor headers, footers, and widgets
  • Elementor Dynamic Tags: Select DCIB fields directly in Elementor controls (requires Elementor Pro)
  • WPForms Smart Tags: Use DCIB fields in WPForms notifications and confirmations (requires WPForms)
  • Dynamic preview: Changes are reflected in real-time in Elementor frontend editor
  • Phone validation: Validates and formats phone numbers with country-specific rules (uses libphonenumber)
  • Global country selector: Set default country for phone number formatting and validation
  • Link placeholders: Auto-generated tel:, mailto:, and map link variants for every field
  • Maps URL override: Custom Google Maps or Apple Maps URL replaces auto-generated address link
  • Email anti-spam: mailto: links encoded to deter harvesters

Elementor Integration

The plugin works seamlessly with Elementor page builder. Placeholders work in:

  • Elementor text widgets
  • Elementor headers and footers
  • Any Elementor content area

Elementor Dynamic Tags

If you have Elementor Pro, you can use Dynamic Tags to select DCIB fields directly in Elementor controls:

  1. In any Elementor control that supports dynamic tags (e.g., text fields)
  2. Click the dynamic tag icon
  3. Look for the “Dynamic Contact Info” group
  4. Select “DCIB Contact Info” from the list
  5. Choose the field you want to display (Phone, Email, Address, or custom fields)

Changes are reflected in real-time in the Elementor frontend editor.

WPForms Smart Tags

If you have WPForms installed, you can use DCIB fields in form notifications and confirmations:

  1. In WPForms form builder, go to Settings > Notifications
  2. In the email message, click “Show Smart Tags”
  3. Look for DCIB tags like {dcib_phone}, {dcib_email}, {dcib_address}
  4. Custom fields will appear as {dcib_your_custom_key}

These tags will be replaced with the current DCIB field values when the email is sent.

Usage

Basic Fields

Use these placeholders in your posts, pages, or widgets:

  • (PHONE) – Displays your phone number
  • (PHONE_LINK) – Outputs a tel: URI for click-to-call links
  • (EMAIL) – Displays your email address
  • (EMAIL_LINK) – Outputs a mailto: URI (auto-encoded against spam harvesters)
  • (ADDRESS) – Displays your address
  • (ADDRESS_LINK) – Outputs a Google Maps search URL (or custom URL if Maps URL field set)

Custom Fields

Create custom fields with unique identifiers in the format (CUSTOMFIELD). The value will be replaced wherever the identifier is used.

Phone, email, and address custom fields automatically get link variants — (CUSTOMFIELD_LINK) for tel:, mailto:, or map URLs.

Shortcode

You can also output any field via the shortcode:

  • [dcib key="PHONE"]
  • [dcib key="EMAIL"]
  • [dcib key="ADDRESS"]
  • [dcib key="YOUR_CUSTOM_KEY"]

Requirements

  • WordPress 5.9 or higher
  • PHP 8.1 or higher

License

This plugin is licensed under the GPL v2 or later.

Credits

Developed by Rotsen Mark Acob

Screenshots

Installation

  1. Upload the ra-dynamic-contact-info-blocks folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Configure your contact information under the ‘Contact Info’ menu in the WordPress admin panel

FAQ

Do I need Elementor or WPForms to use this plugin?

No. Both integrations load only when the respective plugin is active. Elementor Dynamic Tags require Elementor Pro; basic placeholders and shortcodes work with any theme.

Where can I use the placeholders?

Anywhere the content passes through WordPress filters — posts, pages, classic and block widgets, Elementor text widgets, and Elementor templates (headers, footers, archives). Type the placeholder directly into the content, for example (PHONE) or (EMAIL).

How do I create a click-to-call or email link?

Use the link placeholders inside an anchor:

<a href="(PHONE_LINK)">Call us</a>
<a href="(EMAIL_LINK)">Email us</a>
<a href="(ADDRESS_LINK)" target="_blank" rel="noopener">Get directions</a>

(PHONE_LINK) outputs a `tel:` URI, `(EMAIL_LINK)` a spam-obfuscated `mailto:` URI, and `(ADDRESS_LINK)` a Google Maps search URL unless a custom Maps URL is set.

Why is my phone number reported as invalid?

Phone validation depends on the Default Country setting. Choose the correct country first, then enter the number in national or international format. The admin shows the formatted national number when the value is valid.

Can I use the fields without typing placeholders in Elementor?

Yes, with Elementor Pro. Click the dynamic tag icon on any supported control, open the “Dynamic Contact Info” group, choose “DCIB Contact Info”, then pick a field. Changes appear in the Elementor preview without reloading the page.

How do I add my own fields?

Click “Add Custom Field”, enter a key and value, and choose a type (Phone, Email, Address, or Text). Keys are normalized to the (KEY) format. Phone, email, and address custom fields also get a (KEY_LINK) variant automatically.

What happens to my data if I delete the plugin?

The plugin stores values in the dcib_* options. Deleting the plugin through the Plugins screen removes them along with the plugin files. Deactivate only if you want to keep the data.

Does it work with caching plugins?

Yes. Placeholders are replaced server-side when the page renders, so a cached page keeps the values from the moment it was cached. Clear the page cache after updating your contact details.

Where do I report a bug or request a feature?

Open an issue at https://github.com/webdevsuperfast/ra-dynamic-contact-info-blocks/issues.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Dynamic Contact Info Blocks” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.4

  • Official WordPress plugin repository listing

1.0.3

  • Validate and normalize serialized phone tel values during settings sanitization.

1.0.2

  • Fix false phone validation error on first save
  • Revert back plugin URI to public GitHub repository

1.0.1

  • Fixed “Requires at least” to use the major WordPress version and match the plugin header.
  • Replaced the invalid Plugin URI with the author site.
  • Registered a sanitize callback for the custom fields setting instead of a pre_update_option filter.
  • Removed the recurring version migration that could overwrite saved phone numbers and custom fields.
  • Custom field sanitizing now accepts the stored data format, so imports and programmatic updates no longer erase existing fields.
  • Fixed the false “Phone number does not appear to be valid” error on the first save, where the not-yet-stored option was sanitized twice.

1.0

  • Initial release