ibrahimpak
Forum Replies Created
-
Your this post help me, thank you!
Forum: Plugins
In reply to: [WooCommerce] Extra characters appear in product links.Thank you for your helpful suggestions.
First I will delete the product names containing
%
from the database,UPDATE
wp_postsSET
post_name= '' WHERE
wp_posts.
post_nameREGEXP '%'
then I will update the products and the products will be renamed and probably the names will be clean.Forum: Plugins
In reply to: [WooCommerce] Extra characters appear in product links.This issue can be seen in the product names in my database. Not available on some products and not on newly added products. I need to rewrite all the product names into the database. Do you have a recommendation?
Product names on db: https://prnt.sc/CdvItEKePl3N
Forum: Plugins
In reply to: [WooCommerce] Extra characters appear in product links.Hi @nawaz0705
My status report and some more info, only titles with non-English characters have this problem.
I also re-added a product with non-English characters and it comes up a clean link.
Do I need to refresh all connections? What do you recommend?
Note: This is a migration site and there are too many items to delete. So I want to clean the links for fresh start.
### WordPress Environment ###WordPress address (URL): https://sitename.com
Site address (URL): https://sitename.com
WC Version: 6.8.0
REST API Version: ? 6.8.0
WC Blocks Version: ? 8.0.0
Action Scheduler Version: ? 3.4.0
Log Directory Writable: ?
WP Version: 6.0.1
WP Multisite: –
WP Memory Limit: 768 MB
WP Debug Mode: ?
WP Cron: ?
Language: tr_TR
External object cache: –### Server Environment ###
Server Info: Apache
PHP Version: 7.4.30
PHP Post Max Size: 256 MB
PHP Time Limit: 1200
PHP Max Input Vars: 1000
cURL Version: 7.84.0
OpenSSL/1.1.1qSUHOSIN Installed: –
MySQL Version: 5.5.5-10.3.36-MariaDB
Max Upload Size: 256 MB
Default Timezone is UTC: ?
fsockopen/cURL: ?
SoapClient: ?
DOMDocument: ?
GZip: ?
Multibyte String: ?
Remote Post: ?
Remote Get: ?### Database ###
WC Database Version: 6.5.1
WC Database Prefix: wp_
Toplam veritaban? boyutu: 1273.77MB
Veritaban? veri boyutu: 892.89MB
Veritaban? indis boyutu: 380.88MB
wp_woocommerce_sessions: Veriler: 0.05 MB + Dizin: 0.02 MB + Motor InnoDB
wp_woocommerce_api_keys: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_woocommerce_attribute_taxonomies: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_woocommerce_downloadable_product_permissions: Veriler: 0.02 MB + Dizin: 0.06 MB + Motor InnoDB
wp_woocommerce_order_items: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_woocommerce_order_itemmeta: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_woocommerce_tax_rates: Veriler: 0.02 MB + Dizin: 0.06 MB + Motor InnoDB
wp_woocommerce_tax_rate_locations: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_woocommerce_shipping_zones: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_woocommerce_shipping_zone_locations: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_woocommerce_shipping_zone_methods: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_woocommerce_payment_tokens: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_woocommerce_payment_tokenmeta: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_woocommerce_log: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_actionscheduler_actions: Veriler: 99.64 MB + Dizin: 79.81 MB + Motor InnoDB
wp_actionscheduler_claims: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_actionscheduler_groups: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_actionscheduler_logs: Veriler: 78.63 MB + Dizin: 56.14 MB + Motor InnoDB
wp_commentmeta: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_comments: Veriler: 0.02 MB + Dizin: 0.09 MB + Motor InnoDB
wp_e_events: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_e_submissions: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_e_submissions_actions_log: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_e_submissions_values: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_import_detail_log: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_import_log_detail: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_import_postID: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_links: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_noptin_automation_rules: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_noptin_subscribers: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_noptin_subscriber_meta: Veriler: 0.00 MB + Dizin: 0.01 MB + Motor MyISAM
wp_options: Veriler: 22.48 MB + Dizin: 5.92 MB + Motor InnoDB
wp_pmxi_files: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_pmxi_hash: Veriler: 3.52 MB + Dizin: 0.00 MB + Motor InnoDB
wp_pmxi_history: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_pmxi_images: Veriler: 17.55 MB + Dizin: 0.00 MB + Motor InnoDB
wp_pmxi_imports: Veriler: 0.42 MB + Dizin: 0.00 MB + Motor MyISAM
wp_pmxi_posts: Veriler: 7.52 MB + Dizin: 0.00 MB + Motor InnoDB
wp_pmxi_templates: Veriler: 1.52 MB + Dizin: 0.00 MB + Motor InnoDB
wp_postmeta: Veriler: 305.86 MB + Dizin: 159.38 MB + Motor InnoDB
wp_posts: Veriler: 320.78 MB + Dizin: 49.22 MB + Motor InnoDB
wp_social_users: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_termmeta: Veriler: 1.52 MB + Dizin: 0.86 MB + Motor InnoDB
wp_terms: Veriler: 0.20 MB + Dizin: 0.28 MB + Motor InnoDB
wp_term_relationships: Veriler: 14.55 MB + Dizin: 7.52 MB + Motor InnoDB
wp_term_taxonomy: Veriler: 0.19 MB + Dizin: 0.22 MB + Motor InnoDB
wp_usermeta: Veriler: 0.06 MB + Dizin: 0.03 MB + Motor InnoDB
wp_users: Veriler: 0.02 MB + Dizin: 0.05 MB + Motor InnoDB
wp_wc_admin_notes: Veriler: 0.05 MB + Dizin: 0.00 MB + Motor InnoDB
wp_wc_admin_note_actions: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_wc_category_lookup: Veriler: 0.45 MB + Dizin: 0.00 MB + Motor InnoDB
wp_wc_customer_lookup: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_wc_download_log: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_wc_order_coupon_lookup: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_wc_order_product_lookup: Veriler: 0.02 MB + Dizin: 0.06 MB + Motor InnoDB
wp_wc_order_stats: Veriler: 0.02 MB + Dizin: 0.05 MB + Motor InnoDB
wp_wc_order_tax_lookup: Veriler: 0.02 MB + Dizin: 0.03 MB + Motor InnoDB
wp_wc_product_attributes_lookup: Veriler: 6.64 MB + Dizin: 7.45 MB + Motor MyISAM
wp_wc_product_download_directories: Veriler: 0.00 MB + Dizin: 0.01 MB + Motor MyISAM
wp_wc_product_meta_lookup: Veriler: 10.52 MB + Dizin: 13.09 MB + Motor InnoDB
wp_wc_rate_limits: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_wc_reserved_stock: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_wc_tax_rate_classes: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_wc_webhooks: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_woodmart_wishlists: Veriler: 0.02 MB + Dizin: 0.00 MB + Motor InnoDB
wp_woodmart_wishlist_products: Veriler: 0.02 MB + Dizin: 0.02 MB + Motor InnoDB
wp_yith_wcwl: Veriler: 0.00 MB + Dizin: 0.00 MB + Motor MyISAM
wp_yith_wcwl_lists: Veriler: 0.00 MB + Dizin: 0.01 MB + Motor MyISAM### Post Type Counts ###
attachment: 83245
blocks: 8
cms_block: 31
custom_css: 1
customize_changeset: 70
elementor_library: 12
featured_item: 8
mc4wp-form: 1
nav_menu_item: 1060
noptin-form: 1
page: 93
post: 10
product: 47817
product_variation: 29397
revision: 83393
shop_order: 4
woodmart_sidebar: 1
woodmart_size_guide: 1
wp_global_styles: 1
wpcf7_contact_form: 5### Security ###
Secure connection (HTTPS): ?
Hide errors from visitors: ?Hata mesajlar? ziyaret?ilere g?sterilmemelidir.### Active Plugins (11) ###
Contact Form 7: (Takayuki Miyoshi) – 5.6.2
Easy WP SMTP: (wpecommerce
alexanderfoxc) – 1.4.7Loco Translate: (Tim Whitlock) – 2.6.2
Noptin – WordPress Newsletter Plugin: (Newsletter) – 1.7.7
Nextend Social Login: (Nextendweb) – 3.1.5
Term Management Tools: (theMikeD
scribu) – 2.0.1WooCommerce Adres Defteri: (Hall Internet Marketing) – 2.1.3
WooCommerce: (Automattic) – 6.8.1
WP All Import Pro: (Soflyy) – 4.7.3
WP All Import – WooCommerce Import Add-On Pro: (Soflyy) – 3.3.1
YITH WooCommerce Wishlist: (YITH) – 3.12.0### Inactive Plugins (3) ###
Elementor: (Elementor.com) – 3.6.8
Elementor Pro: (Elementor.com) – 3.6.4
Woodmart Core: () – 1.0.34### Dropin Plugins (1) ###
advanced-cache.php: advanced-cache.php
### Settings ###
API Enabled: –
Force SSL: –
Currency: TRY (TL)
Currency Position: right
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: –### WC Pages ###
Ma?aza giri? sayfas?: #872769 – /shop/
Sepet sayfas?: #872768 – /cart/
?deme sayfas?: #872767 – /checkout/
Hesab?m sayfas?: #872766 – /my-account/
?artlar ve ko?ullar: ? Sayfa ayarlanmam??### Theme ###
Name: Flatsome Child
Version: 3.0
Author URL:
Child Theme: ?
Parent Theme Name: Flatsome
Parent Theme Version: 3.15.7
Parent Theme Author URL: https://www.uxthemes.com/
WooCommerce Support: ?### Templates ###
Overrides: flatsome/woocommerce/archive-product.php
flatsome/woocommerce/cart/cart-empty.php
flatsome/woocommerce/cart/cart-shipping.php
flatsome/woocommerce/cart/cart.php
flatsome/woocommerce/checkout/form-checkout.php
flatsome/woocommerce/checkout/form-coupon.php
flatsome/woocommerce/checkout/terms.php
flatsome/woocommerce/checkout/thankyou.php
flatsome/woocommerce/content-product-cat.php
flatsome/woocommerce/content-product.php
flatsome/woocommerce/content-single-product.php
flatsome/woocommerce/content-widget-product.php
flatsome/woocommerce/global/breadcrumb.php
flatsome/woocommerce/global/quantity-input.php
flatsome/woocommerce/global/wrapper-end.php
flatsome/woocommerce/global/wrapper-start.php
flatsome/woocommerce/loop/loop-end.php
flatsome/woocommerce/loop/loop-start.php
flatsome/woocommerce/loop/pagination.php
flatsome/woocommerce/loop/result-count.php
flatsome/woocommerce/loop/sale-flash.php
flatsome-child/woocommerce/myaccount/form-login.php
flatsome-child/woocommerce/myaccount/navigation.php
flatsome/woocommerce/notices/error.php
flatsome/woocommerce/notices/notice.php
flatsome/woocommerce/notices/success.php
flatsome/woocommerce/product-searchform.php
flatsome/woocommerce/single-product/photoswipe.php
flatsome/woocommerce/single-product/price.php
flatsome-child/woocommerce/single-product/product-image.php
flatsome/woocommerce/single-product/product-thumbnails.php
flatsome-child/woocommerce/single-product/rating.php
flatsome/woocommerce/single-product/related.php
flatsome/woocommerce/single-product/review.php
flatsome/woocommerce/single-product/sale-flash.php
flatsome/woocommerce/single-product/share.php
flatsome/woocommerce/single-product/short-description.php
flatsome/woocommerce/single-product/tabs/tabs.php
flatsome/woocommerce/single-product/title.php
flatsome/woocommerce/single-product/up-sells.php
flatsome-child/woocommerce/single-product-reviews.php
flatsome/woocommerce/single-product.php
flatsome/woocommerce/content-product_cat.php### Admin ###
Enabled Features: activity-panels
analytics
coupons
customer-effort-score-tracks
experimental-products-task
experimental-import-products-task
experimental-fashion-sample-products
experimental-product-tour
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
wc-pay-promotion
wc-pay-welcome-page
wc-pay-subscriptions-pageDisabled Features: minified-js
settingsDaily Cron: ? Next scheduled: 2022-08-21 17:47:01 +03:00
Options: ?
Notes: 46
Onboarding: completed### Action Scheduler ###
Tamamla: 307.773
Oldest: 2022-07-18 09:27:35 +0000
Newest: 2022-08-21 14:06:29 +0000Ba?ar?s?z: 17
Oldest: –
Newest: –Bekleyen: 1
Oldest: 2022-08-21 18:11:20 +0000
Newest: 2022-08-21 18:11:20 +0000### Status report information ###
Generated at: 2022-08-21 17:08:57 +03:00
After a long time, my problem was solved with a small and easy method. I leave the code here for those who need it.
Thanks to @wpallimport!
add_filter('wp_all_import_is_post_to_create', 'create_only_if_unique_custom_field', 10, 3); function create_only_if_unique_custom_field( $continue_import, $data, $import_id ) { // Only run for import ID 33 if ( $import_id == 33 ) { // Xml file column product title $value = $data['name']; // Get check on wpdb product title $posts = get_posts([ 'post_type' => 'product', 'title' => $value, ]); return !$posts; } else { // Take no action if a different import ID is running. return $continue_import; } }
- This reply was modified 2 years, 8 months ago by ibrahimpak.
I edited the code as below and it is not working.
How can I get the product name field? Is “post title” correct?
add_filter('wp_all_import_is_post_to_create', 'create_only_if_unique_custom_field', 10, 3); function create_only_if_unique_custom_field( $continue_import, $data, $import_id ) { if ( $import_id == 33 || $import_id == 34 ) { $key = "post_title"; $value = $data['name']; $args = array ( 'post_type' => array( 'post' ), 'meta_query' => array(array( 'key' => $key, 'value' => $value, )), ); // Run the query and do not create post if custom field value is duplicated. $query = new WP_Query( $args ); return !($query->have_posts()); } else { // Take no action if a different import ID is running. return $continue_import; } }
I guess the other code above just checks the names in the file.
What is actually needed is some code to check the database.
The code below is correct but I guess it only checks the custom field. How can I use this code to check the header?
function create_only_if_unique_custom_field( $continue_import, $data, $import_id ) { // Only run for import ID 1. if ($import_id == 1) { // The custom field to check. $key_to_look_up = "my_custom_field"; // The value to check where 'num' is the element name. $value_to_look_up = $data['num']; // Prepare the WP_Query arguments $args = array ( // Set the post type being imported. 'post_type' => array( 'post' ), // Check our custom field for our value. 'meta_query' => array(array( 'key' => $key_to_look_up, 'value' => $value_to_look_up, )), ); // Run the query and do not create post if custom // field value is duplicated. $query = new WP_Query( $args ); return !($query->have_posts()); } else { // Take no action if a different import ID is running. return $continue_import; } } add_filter('wp_all_import_is_post_to_create', 'create_only_if_unique_custom_field', 10, 3);
- This reply was modified 2 years, 9 months ago by ibrahimpak.
Hello,
Unfortunately it continues to uploaded with the same name.
This is the code I’m using, it contains both upload ids.
add_filter( 'wp_all_import_is_post_to_create', 'my_is_post_to_create_filter', 10, 3 ); function my_is_post_to_create_filter( $continue_import, $data, $import_id ) { if ( $import_id == 33 || $import_id == 34 ) { if ( $product = get_page_by_title( $data['name'], OBJECT, 'product' ) ) { return false; } } return true; }
This is the products xml file I use.
<products> <product> <productCode>AKDNBS2041</productCode> <main_category>üst Giyim</main_category> <name> Dantel Nak?? ??lemeli Pedli Bambu Kad?n Büstiyer Krem Bordo </name> <description> 2 Adet Dantel Nak?? ??lemeli Pedli Bambu Kad?n Büstiyer Krem Bordo </description> <listPrice>102.99</listPrice> <quantity>240</quantity> </product> </products>
The code I am using is getting the product name from the install file. Does it get the product name in the database?
It’s really weird that it doesn’t work, everything seems fine but it keeps uploaded the product with the same name.
I’m trying a code like below, but after run import I get the error, “Your server terminated the import process”.
add_filter( 'wp_all_import_is_post_to_create', 'my_is_post_to_create', 10, 3 ); function my_is_post_to_create( $continue_import, $data, $import_id ) { global $product; $product = wc_get_product(get_the_ID()); $current_title = $product->get_name(); $new_title = $data['name']; if ( $import_id == 34 ) { if ( $new_title == $current_title ) { return false; } } return true; }
Forum: Plugins
In reply to: [WooCommerce] Exclude out of stock products from sitemapNow I understand better how the noindex tag actually works.
This will solve the index exclusion issue for out of stock items. Because even if search engine bots see this link, they will not index it.
Thanks for your recommendation @rainfallnixfig
Forum: Plugins
In reply to: [WooCommerce] Exclude out of stock products from sitemapHello @rainfallnixfig
Does adding noindex to links work even if they are in the sitemap?
If so, there will be no need to edit sitemaps.
Forum: Developing with WordPress
In reply to: Exclude out of stock products from sitemapThank you @threadi,
I created a support request on the WooCommerce side.
Forum: Developing with WordPress
In reply to: Exclude out of stock products from sitemapIs the hook used to exclude correct?
add_filter( 'wp_sitemaps_posts_entry', 'exclude_no_stock_products',10,2); function exclude_no_stock_products( $entry, $post ) { // Here is code return $entry; }
These are my import elements, for example, if in site there is already a product named “Omuz F?rf?rl? Tshirt – Bordo”, how can I prevent it from uploaded?
<product> <productCode>AKDNBS2041</productCode> <main_category>üst Giyim</main_category> <name> Omuz F?rf?rl? Tshirt – Bordo </name> <description> Maken üzerinde beden : S Beden Renk : Bordo </description> <Price>59.99</Price> <quantity>240</quantity> </product>
- This reply was modified 2 years, 9 months ago by ibrahimpak.
I tried as above and it upload the previously uploaded products with the same name.