WordPress filter hook

wp_import_post_comments

Fired by 102 WordPress plugins, running on 16.5M+ sites between them.

How to use wp_import_post_comments

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_import_post_comments', function( $post, $post_id, $post2 ) {
	// Change $post here.
	return $post;
}, 10, 3 );

Argument names come from Elementor Agent Ready Website Builder's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

102 plugins that fire wp_import_post_comments

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Elementor Agent Ready Website Builder icon Elementor Agent Ready Website Builder10+ million installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) core/utils/import-export/wp-import.php:772
  2. WordPress Importer icon WordPress Importer2+ million installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) class-wp-import.php:815
  3. Starter Templates: AI-Powered Website Templates for Elementor & Gutenberg icon Starter Templates: AI-Powered Website Templates for Elementor & Gutenberg1+ million installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/lib/starter-templates-importer/importer/wxr-importer.php:1443
  4. WPvivid icon WPvivid900,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/class-wpvivid-importer.php:1216
  5. Royal Addons for Elementor icon Royal Addons for Elementor600,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) admin/import/class-wordpress-importer.php:822
  6. Ocean Extra icon Ocean Extra400,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/onboarding/class/importer/wp-importer.php:842
  7. Blocksy Companion icon Blocksy Companion300,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) framework/features/demo-install/wp-importer.php:1071
  8. Templately icon Templately300,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) modules/full-site-import/WPImport.php:939
  9. Popup Builder icon Popup Builder200,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) com/libs/SGPBImporter.php:827
  10. Kadence Starter Templates icon Kadence Starter Templates200,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) wxr-importer/WXRImporter.php:1322
  11. Starter Sites & Templates by Neve icon Starter Sites & Templates by Neve100,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/Importers/WP/WP_Import.php:553
  12. Jupiter X Core icon Jupiter X Core70,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/control-panel-2/includes/class-wxr-importer.php:1238
  13. Brizy icon Brizy60,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) import/importer.php:480
  14. aThemes Starter Sites icon aThemes Starter Sites30,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) import/wp-content-importer-v2/WXRImporter.php:1327
  15. BetterDocs icon BetterDocs30,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/Admin/Importer/WPImport.php:1346
  16. Timetable and Event Schedule by MotoPress icon Timetable and Event Schedule by MotoPress30,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) classes/models/class-import.php:801
  17. Apollo13 Framework Extensions icon Apollo13 Framework Extensions20,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) design_importer/a13-wordpress-importer/class-apollo13-framework-import.php:485
  18. Rara One Click Demo Import icon Rara One Click Demo Import20,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/extras/class-wxr-importer.php:1257
  19. Envo Extra icon Envo Extra20,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) lib/envothemes-demo-import/includes/panel/classes/importers/class-wordpress-importer.php:601
  20. Demo Importer Plus icon Demo Importer Plus10,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/importers/wxr-importer/class-wxr-importer.php:1520
  21. Animation Addons for Elementor icon Animation Addons for Elementor10,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/admin/base/AaeaddonWXRImporter.php:1525
  22. Futurio Extra icon Futurio Extra10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/demo/classes/importers/class-wp-import.php:815
  23. Ansar Import icon Ansar Import10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/class-wp-import.php:713
  24. Nexter Extension icon Nexter Extension10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) include/nexter-template/importer/class.wordpress-importer.php:844
  25. Responsive Starter Templates icon Responsive Starter Templates10,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/importers/wxr-importer/class-wxr-importer.php:1501
  26. Qode Essential Addons icon Qode Essential Addons10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/admin/inc/admin-pages/sub-pages/import/importer/wordpress-importer.php:904
  27. Solace Extra icon Solace Extra10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) admin/export-import/class-wp-import.php:883
  28. TemplateSpare icon TemplateSpare10,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/companion/importer/class-wxr-importer.php:1306
  29. Hester Core icon Hester Core10,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) core/admin/demo-library/importers/class-wordpress-importer.php:991
  30. AF Companion icon AF Companion9,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/importer/class-wxr-importer.php:1259
  31. Themebeez Toolkit icon Themebeez Toolkit8,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/demo-importer/importer/class-tt-importer-wxr-importer.php:1453
  32. Sinatra Core icon Sinatra Core8,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/admin/demo-library/importers/class-wordpress-importer.php:762
  33. Blaze Demo Importer icon Blaze Demo Importer7,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) wordpress-importer/class-wp-import.php:813
  34. Mystery Themes Demo Importer icon Mystery Themes Demo Importer6,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/wp-importers/class-mtdi-importer.php:870
  35. ThemeHunk Customizer icon ThemeHunk Customizer6,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) import/core/importer/class-wxr-importer.php:1283
  36. Popularis Extra icon Popularis Extra6,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/panel/classes/importers/class-wordpress-importer.php:762
  37. Spexo Addons for Elementor icon Spexo Addons for Elementor6,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/admin/import/importers/wxr-importer/class-wxr-importer.php:1276
  38. Sparkle Demo Importer icon Sparkle Demo Importer5,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) wordpress-importer/class-wp-import.php:759
  39. HashThemes Demo Importer icon HashThemes Demo Importer5,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) wordpress-importer/class-wp-import.php:817
  40. Hunk Companion icon Hunk Companion5,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) import/core/importer/class-wxr-importer.php:1283
  41. News Magazine X Core icon News Magazine X Core4,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) admin/import/importers/wxr-importer.php:1277
  42. Kits, Templates and Patterns icon Kits, Templates and Patterns4,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/importers/wordpress-importer/class-wxr-importer.php:838
  43. SKT Themes Demo Import icon SKT Themes Demo Import4,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/importer/class-wxr-importer.php:1256
  44. News Kit Addons For Elementor icon News Kit Addons For Elementor3,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) admin/importer/class-wordpress-importer.php:821
  45. CubeWP Framework icon CubeWP Framework3,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) cube/importer/wordpress-importer.php:813
  46. WP Travel icon WP Travel3,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/admin/importer/class-wp-import.php:796
  47. WP Layouts icon WP Layouts3,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/site-import/wordpress-importer.php:729
  48. Easy Demo Importer icon Easy Demo Importer2,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) lib/wordpress-importer/class-wp-import.php:975
  49. EnvoThemes Demo Import icon EnvoThemes Demo Import2,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/panel/classes/importers/class-wordpress-importer.php:805
  50. Ashe Extra icon Ashe Extra2,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/importers/wxr-importer.php:1270
  51. aThemeArt Theme Helper icon aThemeArt Theme Helper2,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/panel/classes/importers/class-wordpress-importer.php:805
  52. Restaurant Menu and Food Ordering icon Restaurant Menu and Food Ordering2,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) classes/models/class-import.php:486
  53. Kenta Companion icon Kenta Companion2,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) src/DemoImporter/ContentImporter/WXRImporter.php:826
  54. MantraBrain Starter Sites icon MantraBrain Starter Sites1,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/importers/wordpress-importer/class-mantrabrain-wxr-importer.php:766
  55. Attesa Extra icon Attesa Extra1,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) panel/classes/importers/class-wordpress-importer.php:804
  56. CWW Companion icon CWW Companion1,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/importer/demo-importer/classes/importers/class-wordpress-importer.php:781
  57. Anant Sites icon Anant Sites1,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/class-wp-import.php:684
  58. Zita Site Library for Elementor icon Zita Site Library for Elementor1,000+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) importer/class-wxr-importer.php:1283
  59. Di Themes Demo Site Importer icon Di Themes Demo Site Importer1,000+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/di-multipurpose/importers/class-wordpress-importer.php:802
  60. Vayu Blocks icon Vayu Blocks900+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/vayu-sites/core/importer/class-wxr-importer.php:1345
  61. Operation Demo Importer icon Operation Demo Importer800+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) classes/importers/class-wordpress-importer.php:781
  62. Omnipress icon Omnipress700+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/Libraries/importer/class-wp-import.php:831
  63. Century ToolKit icon Century ToolKit700+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/panel/classes/importers/class-wordpress-importer.php:759
  64. Bard Extra icon Bard Extra600+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/importers/class-wordpress-importer.php:782
  65. Theme One Click Demo Importer icon Theme One Click Demo Importer400+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/core/classes/importer/class-wxr-importer.php:1227
  66. RealPress icon RealPress400+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) import/wordpress-importer/class-wp-import.php:874
  67. CV Demo Importer icon CV Demo Importer300+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/wp-importers/class-cvdi-importer.php:858
  68. Academy Starter Templates icon Academy Starter Templates300+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/library/awesomemotive/wxr-importer.php:1339
  69. IT Listings icon IT Listings200+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/importers/wordpress-importer/class-wxr-importer.php:785
  70. Wishful Companion icon Wishful Companion200+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/panel/classes/importers/class-wordpress-importer.php:762
  71. Vertex Addons for Elementor icon Vertex Addons for Elementor200+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) app/Modules/WPImport/WPImport.php:706
  72. Z Companion icon Z Companion200+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) import/importer/class-wxr-importer.php:1283
  73. Realtyna Provisioning icon Realtyna Provisioning200+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) app/includes/importer/wordpress-importer.php:778
  74. Tally Theme Setup icon Tally Theme Setup100+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/import-xml-old.php:661
  75. Perfectwpthemes Toolkit icon Perfectwpthemes Toolkit100+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/demo-importer/importer/class-pwpt-importer-wxr-importer.php:1285
  76. Templazee icon Templazee100+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/importer/class-wp-import.php:810
  77. Smart One Click Setup icon Smart One Click Setup100+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) inc/CustomWXRImporter.php:1440
  78. Novex Demo Importer icon Novex Demo Importer70+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) lib/wordpress-importer/class-wp-import.php:797
  79. Codegear Starter icon Codegear Starter50+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) import/wp-content-importer-v2/WXRImporter.php:1327
  80. Quick Demo Import icon Quick Demo Import50+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/importers/WXRImporter.php:676
  81. Simple Theme Demo Importer Plugin icon Simple Theme Demo Importer Plugin50+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) wordpress-importer.php:750
  82. LQThemes Companion icon LQThemes Companion40+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/templates-importer/wordpress-importer.php:759
  83. Mirrorgrid Demo Importer icon Mirrorgrid Demo Importer20+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/importer/class-mg-importer-wxr-importer.php:1267
  84. Admire Extra icon Admire Extra20+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) lib/demo/classes/importers/class-wordpress-importer.php:762
  85. EmBe Core icon EmBe Core20+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/redux/inc/extensions/wbc_importer/inc/importer/wordpress-importer.php:673
  86. Long Toolkit icon Long Toolkit20+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) addons/importer/wordpress-importer/wordpress-importer.php:832
  87. PASS Addons icon PASS Addons20+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) admin/common/import/class-wp-import.php:553
  88. Elite Elementor Addons and Widgets icon Elite Elementor Addons and Widgets20+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) admin/import/class-wordpress-importer.php:821
  89. TallyKit icon TallyKit10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) components/importer/inc/wordpress-importer.php:674
  90. Import Kyero Feed icon Import Kyero Feed10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) class-kyero-import.php:903
  91. Reactive LITE icon Reactive LITE10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) reactive-importer.php:771
  92. cm4all-wp-impex icon cm4all-wp-impex10+ installs apply_filters( 'wp_import_post_comments', $post[ContentExporter::SLICE_DATA_POSTS_COMMENTS], $post_id, $post ) inc/impex-import-extension-content.php:315
  93. Scintilla Demo Importer icon Scintilla Demo Importer10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) lib/wordpress-importer/class-wp-import.php:793
  94. WPHobby Demo Import icon WPHobby Demo Import10+ installs apply_filters( 'wp_import_post_comments', $comments, $post_id, $post ) includes/importers/wxr-importer/class-wxr-importer.php:1283
  95. Realty Pack Core icon Realty Pack Core10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) app/importer/wordpress-importer.php:778
  96. Brand Demo Import icon Brand Demo Import10+ installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/wordpress-importer.php:759
  97. Azeen Core icon Azeen CoreFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) inc/demo/classes/importers/class-wordpress-importer.php:759
  98. Codeless Cloud Starter Sites icon Codeless Cloud Starter SitesFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/Importers/WP/WP_Import.php:492
  99. Qube Tools icon Qube ToolsFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/modules/demo/importers/wpimporter.php:762
  100. SaykoAI Companion icon SaykoAI CompanionFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/admin/starter-sites/import/class-wp-importer.php:1067
  101. Hawk Core icon Hawk CoreFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) includes/admin/demo-library/importers/class-wordpress-importer.php:762
  102. Wyvern Toolkit icon Wyvern ToolkitFewer than 10 installs apply_filters( 'wp_import_post_comments', $post['comments'], $post_id, $post ) modules/import-export/inc/importers/content-importer/class-wp-import.php:759

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.