Widget Context

Wordpress Plugin
Download latest - 1.3.2

Developers

jamescollins
kasparsd

Download Stats

Today 100
Yesterday 192
Last Week 1,240
All Time 489,055
Banner 772x250

Use Widget Context to show and hide widgets on certain sections of your site -- front page, posts, pages, archives, search, etc. Use targeting by URLs (with wildcard support) for maximum flexibility.

https://www.youtube.com/watch?v=rEHvqsWoXAE

Premium Support

Subscribe to our Premium Support service and get the PRO version of the plugin for free when its launched! Your support enables consistent maintenance and new feature development, and is greatly appreciated.

Contribute

  • Suggest code improvements on GitHub.
  • Report bugs and suggestions on WordPress.org forums.
  • Help translate to your language.

Documentation

Widget visibility can be configured under individual widget settings under "Appearance Widgets" in your WordPress administration area or through the widget editing interface in the Customizer.

Target by URL

The "Target by URL" is a powerful feature for targeting sections of your website based on the request URLs. It was inspired by a similar feature in the Drupal CMS.

Use relative URLs such as page/sub-page instead of absolute URLs https://example.com/page/sub-page because relative URLs are more flexible and make the logic portable between different domains and server environments.

Wildcards

Use the wildcard symbol * for matching dynamic parts of the URL. For example:

  • topic/widgets/* to match all posts in the widgets category, if your permalink structure is set to /topic/%category%/%postname%.

  • page-slug/* to match all child pages of the page-slug parent page.

  • Use a trailing ?* to capture URL with all query arguments such as utm_source, etc. For example, for every blog/post-slug also include blog/post-slug?*.

Exclude by URL

Specify URLs to ignore even if they're matched by any of the other context rules. For example, enter example/sub-page to hide a widget on this page even when "All Posts" is selected under "Global Sections".


Releases (26 )

Version Release Date Change Log
1.3.2 2020-04-27

(April 27, 2020) =

  • Bugfix: Fix the Widget Context settings link in the widget controls after moving the settings under the "Appearance" menu for usability (closer to the widget settings).
  • Feature: Add a link to the plugin settings in the plugin admin list, too.
1.3.1 2020-04-24

(April 24, 2020) =

  • Bugfix: better support for URL rules with query parameters.
1.3.0 2020-04-23

(April 23, 2020) =

  • Introduce the long-awaited "Exclude by URL" feature to prevent certain URLs from showing or hiding a widget when it's matched by any other visibility rule.
  • Introduce premium support to help maintain the plugin. Subscribe now to get the PRO version of the Widget Context for free when it's launched!
1.2.0 2019-08-20

PHP 5.6 is now the minimum supported version of PHP. Also included is developer tooling update and improved PHP unit tests.

=

1.1.1 2019-06-06

= 1.0.2 = Load available custom post types and taxonomies right before visibility checks to avoid PHP warnings. Run visibility checks only after the main post query has run. Fixes issues with WooCommerce.

= 1.0.1 =

Fix PHP warning in custom post type and taxonomy module.

= 1.0 =

New modular architecture and settings page. Please make sure you test this version before deploying to a production website.

= 0.8.1 =

(1) Revert to a legacy method for attaching widget control settings in order to make it work with old plugins. (2) Fix the word count context logic.

= 0.8 =

Major code rewrite and refactoring to improve plugin performance and usability.

= 0.7.2 =

Fix PHP warnings/notices.

= 0.7.1 =

Confirm that plugin works with the latest version of WordPress.

= 0.7 =

Bug fix: check for active sidebars only after $paged has been set.

= 0.6 =

Performance improvements - don't check if sidebar has any widgets on every widget load.

1.1.0 2018-06-13

(June 13, 2018) = - Fix URL matching for URLs with query strings. - Introduce unit tests for the URL context.

1.0.7 2018-06-05

(June 5, 2018) = - Mark as tested with WordPress 4.9.6. - Use the localisation service provided by WP.org. - Support for Composer.

1.0.6 2018-01-20

(January 20, 2018) = * Fix path to admin scripts and styles, props @tedgeving. * Mark as tested with WordPress 4.9.2.

1.0.5 2017-05-08

(May 8, 2017) = * Confirm the plugin works with the latest version of WordPress. * Add support for continuous testing via wp-dev-lib.

1.0.4 2016-06-13

(May 6, 2016) = * Confirm the plugin works with the latest version of WordPress. * Fix the PHP class constructor warning. * Move the widget context settings link. * Fix the initial context state in the customizer.

1.0.3 2014-11-01
  • Include Russian translation (Thanks Flector!).
  • Add textdomain to the remaining strings.
  • Enable debugging if Debug Bar is available.
1.0.2 2014-07-16
  • Load available custom post types and taxonomies right before visibility checks to avoid PHP warnings.
  • Run visibility checks only after the main post query has run. Fixes issues with WooCommerce.
  • Load our CSS and Javascript files only on widget and customizer admin pages.
1.0.1 2014-07-15
  • Fix PHP warning in custom post type and taxonomy module.
1.0 2014-07-10
  • Public release of the 1.0 refactoring.
0.8.3 2013-10-21

= 0.8.1 = (1) Revert to a legacy method for attaching widget control settings in order to make it work with old plugins. (2) Fix the word count context logic.

= 0.8 = Major code rewrite and refactoring to improve plugin performance and usability.

= 0.7.2 = Fix PHP warnings/notices.

= 0.7.1 = Confirm that plugin works with the latest version of WordPress.

= 0.7 = Bug fix: check for active sidebars only after $paged has been set.

= 0.6 = Performance improvements - don't check if sidebar has any widgets on every widget load.

0.8.2 2013-10-21

= 0.8.1 = (1) Revert to a legacy method for attaching widget control settings in order to make it work with old plugins. (2) Fix the word count context logic.

= 0.8 = Major code rewrite and refactoring to improve plugin performance and usability.

= 0.7.2 = Fix PHP warnings/notices.

= 0.7.1 = Confirm that plugin works with the latest version of WordPress.

= 0.7 = Bug fix: check for active sidebars only after $paged has been set.

= 0.6 = Performance improvements - don't check if sidebar has any widgets on every widget load.

0.8.1 2013-03-15

(1) Revert to a legacy method for attaching widget control settings in order to make it work with old plugins. (2) Fix the word count context logic.

0.8 2013-03-13

Major code rewrite and refactoring to improve plugin performance and usability.

0.7.2 2013-03-12

= 0.7.1 = Confirm that plugin works with the latest version of WordPress.

= 0.7 = Bug fix: check for active sidebars only after $paged has been set.

= 0.6 = Performance improvements - don't check if sidebar has any widgets on every widget load.

0.7.1 2012-09-19

Confirm that plugin works with the latest version of WordPress.

0.7 2009-12-18

Bug fix: check for active sidebars only after $paged has been set.

0.6 2009-12-18

Performance improvements - don't check if sidebar has any widgets on every widget load.

=

0.4.5 2009-07-21
0.4.4 2009-07-16
0.4.3 2009-07-16
0.4.2 2009-07-16