Title: PHP deprecated: preg_replace(): Passing null to parameter
Last modified: January 23, 2024

---

# PHP deprecated: preg_replace(): Passing null to parameter

 *  [Marc Bernard](https://wordpress.org/support/users/luxxor/)
 * (@luxxor)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/)
 * PHP 8.1, CF7 5.8.6
 * `[14-Jan-2024 02:40:22 UTC] PHP Deprecated: preg_replace(): Passing null to parameter#
   3 ($subject) of type array|string is deprecated in /.../wp-content/plugins/contact-
   form-7/includes/formatting.php on line 269`
 * Backtrace:
 * `/wp-content/plugins/contact-form-7/includes/rest-api.php(355): wpcf7_sanitize_unit_tag(
   NULL)`
 * Please fix to avoid issues with CF7 Rest API in higher PHP versions.
 * Thanks
   Marc

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

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17367980)
 * Where can we see the website in question?
 *  Thread Starter [Marc Bernard](https://wordpress.org/support/users/luxxor/)
 * (@luxxor)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17369600)
 * Not sure which form:
 * [https://marcbernardtools.com/about/contact/](https://marcbernardtools.com/about/contact/)
 * or
 * [https://marcbernardtools.com/support/ticket/](https://marcbernardtools.com/support/ticket/)
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17371255)
 * What other plugins and theme do you use on the site?
 *  Thread Starter [Marc Bernard](https://wordpress.org/support/users/luxxor/)
 * (@luxxor)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17373008)
 * List of plugins:
 *     ```wp-block-code
       admin-menu-editor
       advanced-database-cleaner-pro
       akismet
       autoptimize
       cf7-mailchimp
       companion-auto-update
       contact-form-7
       cookie-law-info
       cpo-companion
       duplicate-post
       easy-digital-downloads-pro
       edd-all-access
       edd-auto-register
       edd-free-downloads
       edd-git-download-updater
       edd-invoices
       edd-mail-chimp
       edd-multi-currency
       edd-recurring
       edd-social-discounts
       edd-software-licensing
       edd-software-specs
       edd-stripe
       email-encoder-bundle
       emoji-toolbar
       enable-media-replace
       filebird
       flamingo
       google-analytics-for-wordpress
       health-check
       highlight-search-terms
       http-headers
       image-comparison-block
       log-http-requests
       login-logout-menu
       loginpress
       modula-best-grid-gallery
       open-search-document
       really-simple-ssl
       redirection
       safe-svg
       shortcodes-finder
       site-health-tool-manager
       updraftplus
       webp-express
       wedocs
       widget-context
       wordfence
       wordpress-seo
       wp-fastest-cache
       wpfront-scroll-top
       ```
   
 * Also happens on another of my sites with these plugins:
 *     ```wp-block-code
       akismetcompanion-auto-updatecontact-form-7cookie-noticedisable-gutenbergduplicate-postemail-encoder-bundleenable-media-replacegoogle-analytics-for-wordpresshealth-checkhighslide-integrationhttp-headersinline-google-spreadsheet-viewerjquery-archive-list-widgetnewsletternewsletter-archivenewsletter-extensionsnewsletter-importnewsletter-instasendnewsletter-locknewsletter-wpusersopen-search-documentopen-web-analyticsparticipants-databasepdb-datepickerpdb-field-group-tabsreally-simple-sslthe-events-calendartheme-checktinymce-custom-stylesupdraftplususer-role-editorw3-total-cachewordfencewp-external-linkswp-pollsxnau-plugin-updates
       ```
   
 * Theme is an updated version of [https://github.com/WPChill/cpothemes-theme](https://github.com/WPChill/cpothemes-theme)
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17374254)
 * Try switching to the default theme, deactivating all plugins excluding Contact
   Form 7, Akismet, Flamingo, Health Check, Really Simple SSL and Wordfence Security,
   and clearing all cache data.
 * [Why you are advised to deactivate plugins and switch to the default theme.](https://contactform7.com/2019/12/02/why-you-are-advised-to-deactivate-plugins-and-switch-to-the-default-theme/)

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

The topic ‘PHP deprecated: preg_replace(): Passing null to parameter’ is closed 
to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter/#post-17374254)
 * Status: not resolved