• 30
    5 usages left
  • Home » Useful Articles » Troubleshooting WooCommerce import issues

    Troubleshooting WooCommerce import issues

    post

    By eMagicOne
    article-img-sect-1

    When you order data scraping and specify that you need to upload it to WooCommerce, you get a file configured for the WooCommerce default import tool. However, trying to import scraped data, you get an error.

    article-sect-1

    Viewing the log file, you can learn what prevents you from successfull import. Below are the most common errors and how to correct them.

    “Error getting a remote image. Forbidden”

    This error may occur when you are importing images from URLs.

    WooCommerce Import Error Forbidden

    WooCommerce Import Error – Forbidden

    Change User-Agent

    When WordPress is trying to download an image from another website, it is using the default User-Agent, e.g. “WordPress/5.7; http://example.com/”. Some websites might block the requests that have a User-Agent header other than web-browser’s. A workaround for this is to make WordPress User-Agent header look like web-browser’s. You can do this by installing a third-party plugin or editing a line of code in one of the source files of your store.

    The change should be made in the file: wp-includes/class-http.php

    Locate the following line:

    'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), $url ),

    Replace that line with the following:

    'user-agent' => apply_filters( 'http_headers_useragent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36' ),


    Change dynamic links to static ones

    One of the reasons for getting this error is using links to images with dynamic parameters. Dynamic parameters appear after the question mark (?):

    Image Dynamic URL Example

    Example of image with dynamic URL

    To import images using the default WooCommerce importer, make sure that your image links are static and end with /imgagename.jpg or /imagename.png, the supported WooCommerce formats. The link should not contain any question marks because dynamic links with parameters cannot be imported with the default Woocommerce import tool.

    Save images from links and upload them from a local disk/FTP

    Download all images using some third-party tool or request image scraping with eScraper to get them uploaded to your server. After that, upload image files to the WooCommerce import directory. Then import products with the default WooCommerce import tool with image names specified in the CSV (no link should be in the file). Images will be assigned automatically.

    You can request image files after scraping. We will download all image files for you. This option will cost additionally (depending on the volume of images and their size).

    Use some external solution that supports import from dynamic links

    To import images from links, you can try using external applications like Store Manager for WooCommerce. Store Manager import tool emulates browser download and uploads image files itself into WooCommerce. Store Manager can also read dynamic image links. There is a free 14-days trial version that allows you to upload any number of scraped products smoothly.

    “Sorry, this file type is not permitted for security reasons”

    This error may occur if the description field in the import file contains HTML tags. On some servers, such file can be mis-detected by WordPress. A solution is to add a line of code to your wp-config.php file: define( 'ALLOW_UNFILTERED_UPLOADS', true );

    Here is how you do this:

    1. Connect to your WordPress site via FTP/SFTP.
    2. Your site’s wp-config.php file is located in the root folder, which is the same folder that has the wp-admin and wp-includes folders. Right-click to edit the file:

      WooCommerce Config File Editing

      Open the wp-config file

    3. Find the row /* That's all, stop editing! Happy publishing. */ and abive it paste the code define('ALLOW_UNFILTERED_UPLOADS', true);
    4. WooCommerce Config Adding Allow Unfiltered Uploads Code

      Paste the line of code to allow unfiltered uploads

    5. Save changes to the file.

    For the security reasons, this should be enabled temporarily to perform the import, and then removed from the configuration file. Before editing the config file, it is recommended to make a backup of your store database to ensure you can roll back.

    Please write in the comments if the methods offered above helped. If the issue persists, describe your case in the comments below. We’ll investigate it and try to offer a solution.

    Was this article helpful?

    post

    Import scraped products to WooCommerce hassle-free!

    Try FREE

    COMMENTS
    Related articles

    3 min

    5 Typical Challenges DropShippers Face And How to Solve Them with Website Scraping

    5/5 - (1 vote)

    When you are starting a dropshipping business and contacting possible suppliers you imply that they will provide you information about their products: images, descriptions, prices. Ideally, the manufacturer would give you a catalog with complete product descriptions, large and thumbnail images, product specifications.

    3 min

    A solution to downloading entire website

    5/5 - (1 vote)

    Downloading an entire website sounds like a really big task. Though, there are a number of situations when it has to be done. Moving over to a new, more suitable CMS or shopping cart, backing up huge amounts of information, copying vendor’s content for an affiliate website are just a few of them.

    3 min

    Pick product images from any website with eScraper and import them to your store

    5/5 - (1 vote)

    You have poor images and your supplier provides you images for additional fee only? Now you can grab product images from site easily and import them into your website with eScraper.

    img-form