Artilces

Troubleshooting WooCommerce import issues

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

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 (?):

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:

    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. 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
eScraper

Recent Posts

How to extract product data from any marketplace without any technical skills with eScraper

Do you need to extract product data from any marketplace like Alibaba, Amazon, FaceBook or…

3 months ago

eScraper Smart Scan feature – extract product data with automatic fields detection

Do you need to import products from any site, and you do not have a…

3 months ago

Case study: tracking crowd-marketing activities using web scraping

Store owners most often use eScraper to extract data for their eCommerce needs like building…

1 year ago

eScraper software v.2022.11.0.11 – Press Release

November 4, 2022 - eScraper announces the release of the eScraper data extraction software tailored…

1 year ago

How to scrape and bulk download Shopify images

Are you looking for a method to not only scrape Shopify image URLs but also…

2 years ago

Web Scraping of Australian Car Marketplaces

And if you are interested in scraping Australian car marketplaces, chances are you’re looking for…

2 years ago