Skip to content

Instantly share code, notes, and snippets.

View FileSubmit's full-sized avatar

Tsvetan Tsakov FileSubmit

View GitHub Profile
@FileSubmit
FileSubmit / Noindex_to_query_vars_in_WooCommerce
Last active July 2, 2025 07:33
Noindex to query vars in WooCommerce
// Send an X-Robots-Tag header early.
add_action( 'send_headers', function() {
if ( is_admin() ) {
return;
}
// If this is the WooCommerce “Shop” page, send noindex right away
// If you need the shop page to be indexable, remove
if ( function_exists( 'is_shop' ) && is_shop() ) {
header( 'X-Robots-Tag: noindex, nofollow', true );
@FileSubmit
FileSubmit / wpallimport - bulk attributes
Created April 18, 2024 05:13
wpallimport - bulk attributes
add_action('pmxi_saved_post', 'wp_programator_automatically_import_wpai_params', 10, 2);
/**
* @param $post_id
* @param $xml
*/
function wp_programator_automatically_import_wpai_params($post_id, $xml)
{
$product_attributes = array();
$atts = array(); // Initialize the array to avoid undefined variable warnings.