WPML (WordPress Multilingual Plugin) is a popular multilingual solution that allows you to create and manage websites in multiple languages. When running a multilingual site with Post Views Counter, proper integration ensures that view counts are tracked and displayed correctly across all language versions of your content.
Without proper compatibility, you may encounter issues such as:
- View counts not displaying correctly on translated content
- Inconsistent statistics across different language versions
- Dashboard reports not reflecting multilingual content properly
- Top posts displaying content from all languages mixed together
How It Works
Post Views Counter includes a dedicated WPML integration that automatically handles multilingual tracking and reporting. The integration activates automatically when WPML is detected and ensures that:
- View counts are properly associated with posts in each language
- Dashboard statistics correctly filter views by the active language
- The top posts functionality respects the current language context
- Admin bar and toolbar statistics display accurate counts for the active language
- Term views and taxonomy archives are properly filtered by language
The integration connects to WPML’s language switching mechanism to ensure queries retrieve the correct data for each language version. When you switch languages in the WordPress admin or frontend, Post Views Counter automatically adjusts its queries to match the language context.
Setup
Prerequisites
- Post Views Counter plugin (Lite or Pro)
- WPML plugin installed and configured
- At least one additional language configured in WPML
Installation Steps
- Ensure both Post Views Counter and WPML are installed and activated
- Navigate to Post Views > Integrations
- Verify that the WPML integration is enabled (the integration activates automatically when WPML is detected)
- Configure your tracking settings at Post Views > Counting > Tracking Targets to select which post types should have views counted
No additional configuration is typically required—the integration works automatically once both plugins are active.
Configuration
Tracking Settings
Configure which content types to track at Post Views > Counting > Tracking Targets:
- post_types_count: Select the post types you want to track views for. Each language version of a post will have its own view count.
- taxonomies_count: Enable tracking for taxonomy archives across all languages
- users_count: Enable tracking for author pages in all languages
- other_count: Enable tracking for custom content across languages
- technology_count: Enable tracking for technology-related content
Display Settings
At Post Views > Display > Display Targets, configure where view counts appear:
- post_types_display: Select which post types should display view counts
- page_types_display: Choose which page types show the counter
The display settings apply consistently across all language versions of your site.
Counter Mode Compatibility
All counter modes are compatible with WPML:
- PHP Mode: Works transparently with WPML’s language detection
- JavaScript Mode: Properly identifies the current language for tracking
- REST API Mode: Routes correctly handle multilingual requests
- Fast AJAX: Maintains language context during asynchronous requests
Select your preferred mode at Post Views > Counting > Tracking Behavior > Counter Mode. The WPML integration works regardless of which mode you choose.
Troubleshooting
View Counts Not Showing on Translated Content
Symptoms: View counts display correctly in the default language but not on translated versions.
Solutions:
- Verify that the translated post exists and is published
- Check that the post type is enabled in Post Views > Counting > Tracking Targets
- Ensure the display settings at Post Views > Display > Display Targets include the post type
- Confirm the translated content uses the same post type as the original
Statistics Not Matching Across Languages
Symptoms: Dashboard reports show different totals than expected when viewing different language versions.
Explanation: This is expected behavior. The integration filters statistics by the currently active language in the WordPress admin. Each language version maintains separate view counts for its content. The dashboard queries automatically adjust based on the admin language setting.
Top Posts Widget Not Respecting Language
Symptoms: The top posts widget or shortcode displays posts from all languages instead of the current language.
Solution: The integration automatically filters top posts by the current language context. If you experience issues:
- Ensure WPML’s language negotiation method is properly configured
- Clear any caching plugins that may be interfering with language detection
- Verify the integration is active at Post Views > Integrations
- Check that custom snippets are not overriding most-viewed query behavior
Admin Bar Statistics Incorrect
If the admin bar statistics do not reflect the correct language context:
- Check that you’re viewing the admin in the intended language
- The statistics automatically adjust based on the admin language setting
- Clear browser cache if you recently switched languages
- Verify no custom code is interfering with admin toolbar rendering behavior
Import Data Not Transferring Correctly
If you’re importing view counts from another plugin while using WPML, the import functionality at Post Views > Other > Data Import will handle the data according to the import strategy selected. Language associations are preserved during import when the source data includes them.
Views Stuck or Not Updating
If view counts appear stuck on translated content:
- Check your counter mode at Post Views > Counting > Tracking Behavior > Counter Mode
- If using a caching plugin, ensure it’s compatible with your chosen counter mode
- Verify that the
time_between_countssetting at Post Views > Counting > Tracking Behavior is not preventing repeat visits from being counted - Clear any page cache to ensure the counter script loads fresh
Term Views Not Filtering by Language
Symptoms: Category or tag archive pages show combined view counts from all languages.
Solution: The integration includes dedicated handling for term views. If term views are not filtering correctly:
- Verify that taxonomies_count is enabled at Post Views > Counting > Tracking Targets
- Ensure WPML’s taxonomy translation is properly configured
- Check that custom queries are not bypassing the integration filters
