Skip to content

Instantly share code, notes, and snippets.

@trey8611
trey8611 / migrate-shortcode-image-ids.md
Last active April 3, 2024 03:18
How to migrate shortcode image IDs | Visual Composer / WPBakery / ETC

Migrate shortcode image IDs with WP All Export and WP All Import

Convert the IDs to URLs during the export

Use a custom PHP function ( https://www.wpallimport.com/documentation/export/pass-data-through-php-functions/ ) on the content field to convert the image IDs to URLs. Example shortcode:

[vc_single_image image="177" img_size="full" add_caption="yes" alignment="center" style="vc_box_shadow_border"]

Example function:

@trey8611
trey8611 / delete-all-import-history-logs-data.md
Last active December 2, 2020 14:23
How to delete all history log entries in WP All Import | Custom SQL Query

You can manually delete the physical log files via FTP by deleting the sub-folder(s) inside the /wp-content/uploads/wpallimport/logs/ folder. As for the history log entries in the database (what you see on the "History Logs" page), you'll need to run an SQL query to delete them in bulk (you can run queries with this: https://wordpress.org/plugins/ari-adminer/). For example:

DELETE
FROM `wp_pmxi_history`

Some things to keep in mind here:

  1. Always back up your database before deleting things like this.
@cliffordp
cliffordp / functions.php
Last active September 21, 2024 21:01
WP All Import - set uploads folder to the Import ID
<?php
/**
* WP All Import: Upload media to a directory named after the Import ID.
*
* @link https://gist.github.com/cliffordp/fc0fa5686d6a127246224f1565b60128 This snippet.
* @link https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/wp_all_import_images_uploads_dir.php
*
* @see PMXI_Import_Record::process()
* @see wp_upload_dir()
*
@trey8611
trey8611 / import-optimizations.md
Last active July 1, 2024 03:41
WP All Import - Optimize your import speed.
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active November 18, 2024 01:03
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@trey8611
trey8611 / query_cyrillic_attribute_values.md
Last active April 17, 2024 17:23
WP All Import - use XPath Query based on Cyrillic attribute value

XPath doesn't allow you to make queries with Cyrillic symbols unless you disable XML pre-processing by adding this code in your child themes functions.php file (or in a plugin like Code Snippets: https://wordpress.org/plugins/code-snippets/):

function wpai_is_xml_preprocess_enabled( $is_enabled ) {
	return false;
}
add_filter( 'is_xml_preprocess_enabled', 'wpai_is_xml_preprocess_enabled', 10, 1 );

Once that code is in place, upload your file to an import and queries like this will be possible: