{CODICTS} Snippets is now available

MyListing Direct Messages Control

The {CODICTS} MyListing Direct Messages Control plugin gives site administrators granular control over who can send and receive direct messages on their MyListing directory site. You can disable the “Direct Message” button on listing pages based on listing type or WooCommerce package, and disable the “Compose Message” button in the site header based on WordPress user role.

This is especially useful for monetizing messaging — restrict direct messages to premium listing packages so users must upgrade to receive inquiries.

Important: MyListing’s built-in Direct Messages feature must be enabled under Theme Tools → Direct Messages for this plugin to have any effect. No child theme is required.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

After activation, navigate to Direct Messages Control in the WordPress admin sidebar to configure your restrictions.


Key Features

FeatureDescription
Listing Type RestrictionsDisable the “Direct Message” button on single listing pages for entire listing types (e.g., disable messaging for all “Events” listings).
Package-Level RestrictionsDisable messaging only for specific WooCommerce listing packages within a type. Keep messaging enabled for premium packages while disabling it for free/basic packages.
User Role RestrictionsRemove the “Compose Message” / messaging center button from the site header for specific WordPress user roles.
Independent LayersListing-level and user role restrictions work independently — use one, the other, or both simultaneously.
Monetization ReadyCreate upgrade incentives by restricting messaging to premium packages.

How It Works

The plugin operates on two independent layers:

Layer 1 — Listing-Level Control (Single Listing Pages)

When a visitor views a single listing page, the plugin checks the listing’s type and its assigned WooCommerce package. If the combination matches a restricted configuration, the “Direct Message” button is removed from the listing page.

Layer 2 — User Role Control (Site-Wide Header)

When a logged-in user loads any page, the plugin checks their WordPress role. If their role is in the disabled list, the “Compose Message” / messaging center is removed from the site header.

LayerWhat’s RemovedWhere
Listing-levelThe “Direct Message” buttonSingle listing pages only
User roleThe messaging center / compose buttonSite header on all pages

Note: These two layers are independent. Disabling the header compose button does not disable listing-page DM buttons, and vice versa. To fully restrict a user from all messaging, configure both layers.


Admin Settings

Navigate to Direct Messages Control in the WordPress admin sidebar to access the settings page.

Listing Type Restrictions

For each listing type registered in your MyListing installation, you’ll see a configuration block with the following options:

SettingDescription
Enable restrictions?Master toggle. When checked, restrictions are active for this listing type. When unchecked, all listings of this type retain full messaging capability.
Disable for all packagesWhen checked, the DM button is removed from all listings of this type, regardless of their package. The per-package checkboxes are hidden.

Package-Level Restrictions

When “Enable restrictions” is checked and “Disable for all packages” is unchecked, you’ll see a list of all WooCommerce products assigned as listing packages for that listing type:

Check a package to disable direct messages for listings using that package. Uncheck a package to allow direct messages for listings using that package.

Monetization tip: Disable messaging on your free/basic packages and keep it enabled on premium packages. This creates a compelling upgrade incentive — users who want to receive inquiries via direct message must upgrade to a premium listing package.

If no WooCommerce packages are configured for a listing type, you’ll see a “No available packages” message. Packages are WooCommerce products assigned to a listing type in the MyListing listing type editor.

User Role Restrictions

Below the listing type settings, the User Roles section lists every editable WordPress role (Administrator, Editor, Author, Contributor, Subscriber, and any custom roles).

Check “Disable?” next to a role to remove the messaging center / compose message button from the site header for users with that role.

Note: This removes the ability for users of that role to initiate new conversations from the header. It does not prevent them from receiving messages if another user messages them from a listing page. If a user has multiple roles and any of their roles is in the disabled list, the messaging center is removed.


Use Cases

Upsell Premium Packages

Disable direct messages for free or basic listing packages. Users who want to receive inquiries via direct messages must upgrade to a premium package — creating a revenue-generating upgrade path.

Restrict by Business Type

If you have multiple listing types (e.g., “Restaurants,” “Hotels,” “Events”), enable messaging only for types where communication is critical (e.g., Hotels for booking inquiries) and disable it for others.

Limit Messaging to Verified Users

Create a custom WordPress role for verified/approved users and disable messaging for the default “Subscriber” role. Once users are verified and assigned the appropriate role, messaging becomes available.

Admin-Only Messaging

Disable the compose button for all user roles except administrators, allowing only site admins to initiate conversations while listings can still receive messages.


Example Setup

1. Activate the plugin with the MyListing theme active and Direct Messages enabled under Theme Tools → Direct Messages.

2. Navigate to Direct Messages Control in the admin sidebar.

3. Under the “Places” listing type, check Enable restrictions.

4. Leave “Disable for all packages” unchecked to use per-package control.

5. In the package list, check “Free Package” and “Basic Package” to disable messaging for those packages. Leave “Premium Package” unchecked so premium listings retain messaging.

6. Under the “Events” listing type, leave Enable restrictions unchecked — all event listings keep full messaging capability.

7. In the User Roles section, check “Subscriber” to remove the compose/messaging center from the header for subscribers.

8. Click Save.

Now, visitors viewing a “Places” listing with a free or basic package won’t see the Direct Message button. Premium “Places” listings and all “Events” listings retain the button. Subscribers won’t see the messaging center in the header, but users with other roles (Author, Editor, Administrator) can still compose messages from the header.


Frequently Asked Questions

Does this work with the Voxel theme?

No. This plugin is built specifically for the MyListing Theme. It relies on MyListing’s listing type system, package structure, and direct messaging UI.

Does this require a child theme?

No. The plugin does not override any template files and works with or without a child theme.

Is there a settings page?

Yes. Navigate to Direct Messages Control in the WordPress admin sidebar to configure listing type restrictions, package-level restrictions, and user role restrictions.

Will this block the messaging API entirely?

No. The plugin removes the UI buttons that trigger the messaging flow. Users cannot initiate messages through normal site interaction, but the underlying messaging endpoints are not blocked. For most use cases this is sufficient, as users have no way to access the messaging flow without the buttons.

Can I restrict messaging for specific individual listings?

No. Restrictions are applied at the listing type level or the WooCommerce package level, not on individual listings.

Does disabling the header compose button also disable listing-page DM buttons?

No. The two restrictions are independent. The user role restriction only affects the header messaging center. The listing type/package restriction only affects the DM button on single listing pages. To fully restrict a user, configure both layers.

What happens if a user has multiple roles?

If any of the user’s roles is in the disabled list, the messaging center is removed from the header.

I don’t see any packages listed under a listing type. Why?

Packages are WooCommerce products assigned to a listing type in the MyListing listing type editor. If no WooCommerce products are configured as packages for that type, the plugin displays “No available packages.” Add listing packages in your listing type’s configuration first.

Does the plugin create any database tables?

No. All settings are stored as a single entry in the WordPress options table. No custom database tables are created.

What happens if MyListing’s Direct Messages feature is disabled?

The plugin has no effect if MyListing’s Direct Messages are not enabled. Ensure Direct Messages are turned on under Theme Tools → Direct Messages in the MyListing settings.


Troubleshooting

DM Button Still Showing on a Restricted Listing

CauseSolution
“Enable restrictions” not checkedGo to Direct Messages Control settings and ensure the checkbox for the listing type is checked.
Wrong package restrictedVerify which WooCommerce package the listing is using (check the listing’s _package_id meta). Ensure that specific package is checked in the disabled list.
“Disable for all packages” not checked and no packages selectedEither check “Disable for all packages” to restrict the entire type, or check specific packages in the list.
CachingIf your site uses page caching, clear the cache after changing settings. The plugin uses JavaScript to remove buttons, which may be cached.
Plugin not activatedGo to Plugins → Installed Plugins and verify the plugin is active.

Messaging Center Still Showing in Header for a Restricted Role

CauseSolution
Role not checked in settingsGo to Direct Messages Control settings and check “Disable?” next to the user role in the User Roles section.
User has multiple rolesThe messaging center is only removed if at least one of the user’s roles is disabled. Verify the user’s assigned roles.
User is not logged inRole restrictions only apply to logged-in users. Guest visitors are not affected by role restrictions.
CachingClear page cache after changing settings.

No Packages Listed Under a Listing Type

CauseSolution
No WooCommerce packages configuredPackages are WooCommerce products assigned to a listing type in the MyListing listing type editor. Go to Listing Types, edit the type, and add WooCommerce products as listing packages.
WooCommerce not activeWooCommerce must be installed and active for package-level restrictions to work.

Settings Page Not Loading

CauseSolution
MyListing theme not activeThe plugin requires the MyListing theme. If not detected, an admin error notice is displayed and the settings page does not load. Go to Appearance → Themes and activate MyListing.
Plugin not activatedGo to Plugins → Installed Plugins and verify the plugin is active.

For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved