Title: Uncaught TypeError: count()
Last modified: September 20, 2025

---

# Uncaught TypeError: count()

 *  Resolved [mtg169](https://wordpress.org/support/users/mtg169/)
 * (@mtg169)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-count-2/)
 * The 4.1.0 update is throwing the following fatal error on multiple sites. Can
   you add better data type handling?
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/DatasetModel.php:232Stack trace:#0 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/ProjectModel.php(623): MPG_DatasetModel::create_index(3)#1 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/helpers/Helper.php(505): MPG_ProjectModel::mpg_update_project_by_id(3, Array, true)#2 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(63): MPG_Helper::mpg_live_project_data_update(Object(stdClass))#3 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#4 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#5 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#6 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#7 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#8 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#9 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#10 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#11 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#12 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#13 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#14 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#15 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#16 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#17 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#18 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#19 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#20 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#21 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#22 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#23 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#24 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#25 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#26 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#27 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/LogsController.php(33): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#28 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/CoreModel.php(73): MPG_LogsController::mpg_write('', 'warning', 'Project has no ...')#29 /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/controllers/CoreController.php(223): MPG_CoreModel::mpg_get_redirect_rules('/actuator/env/')#30 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(324): MPG_CoreController::mpg_view_multipages_standard('')#31 /wordpress/core/6.8.2/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)#32 /wordpress/core/6.8.2/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#33 /wordpress/core/6.8.2/wp-includes/template-loader.php(13): do_action('template_redire...')#34 /wordpress/core/6.8.2/wp-blog-header.php(19): require_once('/wordpress/core...')#35 /wordpress/core/6.8.2/index.php(17): require('/wordpress/core...')#36 {main}  thrown in /srv/htdocs/wp-content/plugins/multiple-pages-generator-by-porthas/models/DatasetModel.php on line 232
       ```
   

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

 *  Plugin Support [Vytis](https://wordpress.org/support/users/bvytis/)
 * (@bvytis)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-count-2/#post-18650779)
 * Hi [@mtg169](https://wordpress.org/support/users/mtg169/),
   Thank you for reporting
   this issue and apologies for the inconvenience.We added a fix and it will be 
   released soon with the next release of the plugin this week.
 *  Plugin Support [Vytis](https://wordpress.org/support/users/bvytis/)
 * (@bvytis)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-count-2/#post-18652001)
 * Hi [@mtg169](https://wordpress.org/support/users/mtg169/),
   Today we made a release
   where this issue is addressed. Thanks again for reporting it.

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

The topic ‘Uncaught TypeError: count()’ is closed to new replies.

 * ![](https://ps.w.org/multiple-pages-generator-by-porthas/assets/icon-128x128.
   gif?rev=3274397)
 * [MPG – Multiple Page Generator, Bulk Landing Pages & Programmatic SEO](https://wordpress.org/plugins/multiple-pages-generator-by-porthas/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multiple-pages-generator-by-porthas/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multiple-pages-generator-by-porthas/)
 * [Active Topics](https://wordpress.org/support/plugin/multiple-pages-generator-by-porthas/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multiple-pages-generator-by-porthas/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multiple-pages-generator-by-porthas/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Vytis](https://wordpress.org/support/users/bvytis/)
 * Last activity: [8 months, 1 week ago](https://wordpress.org/support/topic/uncaught-typeerror-count-2/#post-18652001)
 * Status: resolved