# \[ERROR] Failed to import "Home 2" page

### - You get an error that you cannot import home pages when importing demo data <a href="#you-get-an-error-that-you-cannot-import-home-pages-when-importing-demo-data" id="you-get-an-error-that-you-cannot-import-home-pages-when-importing-demo-data"></a>

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrDDvIKPQvgLvQ5xJBSo%2Fuploads%2Fs2RoJCs6RHpfZVfsfNMA%2Fimage.png?alt=media&#x26;token=c2879463-7f15-4e6d-84d2-3bf91a9b905a" alt=""><figcaption></figcaption></figure>

### - Cause: <a href="#cause" id="cause"></a>

The problem may be due to a security plugin/or a security configuration that prevents pages containing Emoij characters from being added. Because the theme's home pages contain Emoji characters, WordPress cannot import them.

### - Resolve: <a href="#resolve" id="resolve"></a>

1. The workaround is that you need to find your security plugin or security configuration and temporarily close it.
2. Or a simpler way is to use [this custom PHP function](https://stackoverflow.com/questions/63100373/wordpress-unable-to-save-or-update-posts-with-emoji) to remove the Emoji characters in the demo pages and then import will work fine.<br>

   ```bash
   add_filter( 'wp_insert_post_data', function( $data, $postarr ) {
   if ( ! empty( $data['post_content'] ) ) {
       $data['post_content'] = wp_encode_emoji( $data['post_content'] );
   }
   return $data;
   }, 99, 2 );
   ```

   \
   \
   **To add a PHP function to your WordPress site:**

   * **Navigate to Theme File Editor:** go to **Appearance > Theme File Editor**.
   * **Select the `functions.php` File:**
     * On the right side, you’ll see a list of theme files. Find and click on `functions.php` under the **Theme Files** section. This file is typically listed as **Theme Functions**.
   * **Add Your PHP Function**
   * **Save**

​​
