Title: Selective Microdata + View Count
Last modified: December 16, 2021

---

# Selective Microdata + View Count

 *  Resolved [kbowson](https://wordpress.org/support/users/kbowson/)
 * (@kbowson)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/)
 * Hey Frank,
 * —Selective Microdata—
    Is there any way to have the microdata output be a bit
   more selective? For example, we only output microdata if channel = [our channel]
   or? If this is not currently possible, could you point my developer in the right
   direction?
 * —View Count—
    I noticed that there is a schema selection for ‘views’. Is there
   an ability to pull this data from the YouTube API and serve this as part of the
   microdata?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [kbowson](https://wordpress.org/support/users/kbowson/)
 * (@kbowson)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15171665)
 * Oh and is there any way to create a video sitemap using the plugin that I am 
   not seeing? If no, any plugin that wp youtube lyte integrates well with for this?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15172994)
 * -> selective microdata: I could add a filter to allow you(r developer) to disable/
   enable microdata, but the logic to show/ not show the microdata will still have
   to be added off course.
 * -> view count: I could add some filters left and right to request & store extra
   data from the YT API, which could also be useful to remove microdata-data (yeah)
   if channel ID is not yours (again; logic to be added)?
 * -> video sitemap: no idea I’m afraid, sorry.
 * I’ll add some of those filters in the beta version (on github), more soon.
 * cheers,
    frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15173013)
 * Update for selective microdata: that can already be done with the `lyte_settings`
   filter which allows one to change the `$lyteSettings` array, inclucing `$lyteSettings['
   microdata']`.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15173112)
 * ok, see [https://github.com/futtta/wp-youtube-lyte/commit/9cc5d0a5b44ad70f4409173a44d42aaeaff2f2c8](https://github.com/futtta/wp-youtube-lyte/commit/9cc5d0a5b44ad70f4409173a44d42aaeaff2f2c8)
 * with those you(r developer) could/ should have fun with filters:
    1. use the new `lyte_filter_ytapi_video_params` filter to ensure view count (part
       of `statistics`) is requested from the YT API
    2. use the new `lyte_filter_ytapi_pre_store_results` filter to ensure the view 
       count is extracted and cached AND to remove e.g. `description` if the channelID(
       which is in the YT API response is not yours
    3. use the existing `lyte_match_postparse_template` which now has the YT response
       array as extra parameter to alter the LYTE output (e.g. to add the view count(
       from the `statistics` parameter somewhere)
 * enjoy! 😉
    frank
 *  Thread Starter [kbowson](https://wordpress.org/support/users/kbowson/)
 * (@kbowson)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15174605)
 * You’re the man. Thank you so much Frank – these are (look) AMAZING. I will pass
   these along as they are a bit above my paygrade. Thank you so much!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15174644)
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/wp-youtube-lyte/reviews/#new-post)!
   🙂

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Selective Microdata + View Count’ is closed to new replies.

 * ![](https://ps.w.org/wp-youtube-lyte/assets/icon-128x128.png?rev=1836005)
 * [WP YouTube Lyte](https://wordpress.org/plugins/wp-youtube-lyte/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-youtube-lyte/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-youtube-lyte/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-youtube-lyte/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-youtube-lyte/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/selective-microdata-view-count/#post-15174644)
 * Status: resolved