wpCodesLab Visibility Conditions for Elementor

Description

wpCodesLab Visibility Conditions for Elementor adds a powerful and lightweight Visibility Conditions panel directly to the Advanced tab of every Elementor element. Create conditional display rules, choose whether matching conditions show or hide the element, and let WordPress evaluate everything securely on the server before any HTML is rendered.

Because restricted content is never rendered on the server, it never appears in the page source, cannot be inspected via developer tools, is never indexed by search engines, and adds zero weight to your page load.

User Conditions

  • Login Status: Display content exclusively to logged-in members or logged-out guests.
  • User Roles: Target one or more user roles with flexible comparison (“Is one of” or “Is none of”). Works with default WordPress roles and custom roles created by membership or eCommerce plugins.
  • Specific Users: Target individual users by User ID, username, or email address with “Is one of” or “Is none of” logic.
  • User Capability: Show or hide content based on WordPress capabilities (e.g. edit_posts, manage_options, or custom capabilities) using “User can” or “User cannot”.
  • Account Age: Target accounts registered more than or less than a specified number of days ago. Perfect for welcoming new members or offering loyalty perks to long-time users (guests never match).

Visitor & Session Conditions

  • Visit Count: Tailor content based on how many browsing sessions a visitor has had. Greet first-time visitors with a welcome offer, or display special promotions to returning visitors.
  • Comprehensive Operators: Evaluate visit numbers using Equal to, Not equal to, Greater than, Greater than or equal to, Less than, Less than or equal to, or Between min and max ranges.
  • Cache-Compatible Tracking: Uses browser sessions and lightweight client-side cookies so visit counting continues to work reliably even behind full-page caching solutions.

Flexible Logic & Actions

  • Show or Hide: Decide whether matching conditions will show or hide the selected element.
  • Combine Conditions (AND / OR): Combine multiple rules with All conditions match (AND logic) or Any condition matches (OR logic).
  • Universal Element Support: Works seamlessly on all Elementor elements including Widgets, Sections, Columns, and Flexbox Containers.

Performance & Cache Guard

  • Automatic Cache Exclusion: Pages using dynamic visibility conditions can be automatically excluded from full-page cache plugins to prevent visitors from seeing cached states meant for others. Works out of the box with WP Rocket, LiteSpeed Cache, W3 Total Cache, and WP Super Cache.
  • Logged-in User Sync: Automatically syncs visit counts to user profiles so counts persist across devices and browsers for logged-in users.
  • Editor Preview Options: Keep restricted elements accessible on the canvas while designing, or preview condition evaluation live inside the Elementor editor.
  • Admin Debugging Tools: Enable debug comments in page source and an admin-only floating status bar to inspect condition evaluations during setup.
  • Developer Hooks: Extensible actions and filters for custom requirements (wpcodeslab_vc_should_render, wpcodeslab_vc_visitor_count, wpcodeslab_vc_prevent_caching, etc.).

Screenshots

Installation

  1. Upload the plugin folder to /wp-content/plugins/, or install it via WordPress Admin under Plugins Add New.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress (Elementor 3.5+ must be installed and activated).
  3. Edit any page or template with Elementor.
  4. Select any Widget, Section, Column, or Container, navigate to Advanced Visibility Conditions, and switch on Enable Conditions.
  5. Configure global settings under Settings Visibility Conditions (caching rules, visit counting mode, cookie expiration, and debug options).

FAQ

Does restricted content still load in the page source?

No. Conditions are evaluated on the server using Elementor’s native render filters (elementor/frontend/{element}/should_render). If an element is restricted, its HTML, inline styles, and scripts are never generated or delivered to the browser.

Does this work with Elementor Flexbox Containers?

Yes. Visibility Conditions supports Flexbox Containers, Sections, Columns, and all standard and third-party Elementor widgets.

Will this work with my caching plugin?

Yes. When Cache Guard is enabled in Settings Visibility Conditions, the plugin automatically signals your caching system (WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache) and sends standard no-cache headers on pages containing active visibility rules.

What counts as a visit in the Visitor Count condition?

A visit represents a unique browsing session. The counter increases once per session (when a visitor arrives after closing their browser or after session expiration), rather than on every individual page view.

How do I edit elements if they are hidden by a condition?

By default, the plugin’s Editor Preview setting is configured to “Always show restricted elements while editing”, keeping all elements visible and easily selectable on the Elementor canvas. You can toggle this behavior under Settings Visibility Conditions.

How can I troubleshoot or test my visibility rules?

Enable “Debug mode” under Settings Visibility Conditions. When logged in as an administrator, you will see a debug bar at the bottom of the page showing the current user status and rule results, as well as descriptive HTML comments next to restricted elements in the page source.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“wpCodesLab Visibility Conditions for Elementor” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release.
  • Server-side conditional rendering for Elementor widgets, columns, sections, and containers.
  • User display rules: login status, user roles, specific users, capabilities, and account age.
  • Visitor display rules: session-based visit counting with complete comparison operators.
  • Cache Guard: automated cache exclusions for WP Rocket, LiteSpeed, W3 Total Cache, and WP Super Cache.
  • Administrator debug bar and HTML troubleshooting comments.