Title: Remove strings from title
Last modified: November 28, 2020

---

# Remove strings from title

 *  Resolved [stathis_k91](https://wordpress.org/support/users/stathis_k91/)
 * (@stathis_k91)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/remove-strings-from-title/)
 * Hi,
 * can you please help me what function needed to remove sku strings in the middle
   of product title?
 * example title: Reebok Αθλητικό Παπούτσι Αγόρι Royal Cljog EF3740 – ΧΑΚΙ
    remove
   sku: EF3740
 * another one example: Us Golf Club Κλειστό Πέδιλο Αγόρι S20-SUK653 – ΜΠΛΕ-ΚΙΤΡΙΝΟ
   
   remove sku: S20-SUK653
 * Regards,
    Stathis
    -  This topic was modified 5 years, 6 months ago by [stathis_k91](https://wordpress.org/support/users/stathis_k91/).

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

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/remove-strings-from-title/#post-13751999)
 * Hey [@stathis_k91](https://wordpress.org/support/users/stathis_k91/),
 * If the SKU is always right before the dash, and there’s a space before it, something
   like this should work (note: untested example that may need to be adjusted):
 *     ```
       function my_remove_sku( $title ) {
       	$title = explode( ' - ', $title );
       	$first = explode( ' ', $title[0] );
       	array_pop( $first );
       	return implode( ' ', $first ) . ' - ' . $title[1];
       }
       ```
   
 *  Thread Starter [stathis_k91](https://wordpress.org/support/users/stathis_k91/)
 * (@stathis_k91)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/remove-strings-from-title/#post-13779553)
 * Hi,
 * doesn’t work,
 * for this title: Reebok Αθλητικό Παπούτσι Αγόρι Royal Cljog EF3740 – ΧΑΚΙ
    it 
   returned: Reebok Αθλητικό Παπούτσι Αγόρι Royal Cljog EF3740 – –
 * for a title like this: Us Golf Club Κλειστό Πέδιλο Αγόρι S20-SUK653 – ΜΠΛΕ-ΚΙΤΡΙΝΟ
   
   it returned: Us Golf Club Κλειστό Πέδιλο Αγόρι S20-SUK653 – –
 * Regards,
    Stathis
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/remove-strings-from-title/#post-13809945)
 * Hi [@stathis_k91](https://wordpress.org/support/users/stathis_k91/),
 * I’m afraid I don’t have any more examples. You’ll need to adjust the code to 
   make it work.
 *  Thread Starter [stathis_k91](https://wordpress.org/support/users/stathis_k91/)
 * (@stathis_k91)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/remove-strings-from-title/#post-13812403)
 * Thanks support team.

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

The topic ‘Remove strings from title’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [stathis_k91](https://wordpress.org/support/users/stathis_k91/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/remove-strings-from-title/#post-13812403)
 * Status: resolved