Skip to content

Content type exclusion UI missing cpt: prefix guidance #233

@parhumm

Description

@parhumm

Summary

The Content Types exclusion field in Settings > Exclusions lists post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login as examples — but does not mention that custom post types require the cpt: prefix (e.g., cpt:product, cpt:event).

This causes users to enter just the post type slug (e.g., product), which doesn't match the internal format cpt:product used by Utils::getContentInfo().

Source: Support forum — "Problems with recent updates" by tkbuhler

Root Cause

In src/Tracker/Utils.php:265-269, single post types that are not post are prefixed:

if (($post_type = get_post_type()) != 'post') {
    $post_type = 'cpt:' . $post_type;
}

But admin/config/index.php:591-594 only describes built-in types:

Enter a list of Slimstat content types that should not be tracked: post, page, attachment, tag, 404, taxonomy, author, archive, search, feed, login, etc.

Proposed Fix

Update the description in admin/config/index.php to include:

For custom post types, use the cpt: prefix (e.g., cpt:product, cpt:event).

Severity

Medium — Silently fails to exclude CPT content. No error shown.

Code References

File Lines Description
src/Tracker/Utils.php 265-269 CPT content type prefixed with cpt:
admin/config/index.php 591-594 UI description — missing prefix guidance
src/Tracker/Processor.php 158-161 Content type exclusion check
src/Tracker/Utils.php 53-69 isBlacklisted() pattern matcher

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions