You can control the visibility of widgets on different pages using the Jetpack plugin. This allows you to show widgets on particular posts, pages or views of your site.
We have used this a lot on this site as our examples mostly only show up on the page that describes them.
- Activate Jetpack plugin, if not already activated Dashboard->Plugins
- Activate the ‘Widget Visibility’ Module- Dashboard->Jetpack-> Settings
- Adjust the setting of widgets as wanted.
You can, as seen in the first screenshot have multiple conditions. So you could have posts with a particular tag and category.