Use case
Import AliExpress reviews to your WooCommerce store
Your product has thousands of reviews on AliExpress and none in your shop. Pull them as JSON and create native WooCommerce reviews with a few lines of PHP.
Why not a plugin?
Review importers that scrape AliExpress break whenever the page changes, and many store the reviews in their own tables, so your theme, your schema markup and your star ratings ignore them.
WooCommerce reviews are just WordPress comments of type review with a rating meta value. If you create them yourself from clean JSON, they show up everywhere a normal review does: product tabs, average rating, structured data and review widgets.
How it works
- Find the AliExpress product ID in the URL: the number in
aliexpress.com/item/1005006123456789.html. - Choose the reviews: only 5 stars (
filter=5), only with photos (filter=image) or from your customers’ country (filter=local&country=US). - Translate them with
lang(es_ES,fr_FR,de_DE…) so they match your shop’s language. - Insert them as WooCommerce reviews, keeping the AliExpress review id so a second run never creates duplicates.
Example: from AliExpress to WooCommerce reviews
Run this from a WP-CLI script or a scheduled task. It reads the 5-star reviews of an AliExpress product and creates them as reviews of a WooCommerce product. Replace $wc_product_id with the id of the product in your shop.
<?php
// Create WooCommerce reviews from the 5-star reviews of an AliExpress product.
// Run it with WP-CLI (wp eval-file import-reviews.php) or from a scheduled task.
$wc_product_id = 123; // your WooCommerce product
$response = wp_remote_get('https://api.aliexpress-reviews.com/v1/reviews/1005006123456789?filter=5&pageSize=20', [
'headers' => ['x-api-key' => getenv('REVIEWS_API_KEY')],
'timeout' => 30,
]);
if (is_wp_error($response) || wp_remote_retrieve_response_code($response) !== 200) {
exit('Request failed');
}
$reviews = json_decode(wp_remote_retrieve_body($response), true)['data'];
foreach ($reviews as $r) {
// Skip reviews imported on a previous run.
$exists = get_comments([
'post_id' => $wc_product_id,
'meta_key' => 'aliexpress_review_id',
'meta_value' => $r['id'],
'count' => true,
]);
if ($exists) continue;
wp_insert_comment([
'comment_post_ID' => $wc_product_id,
'comment_author' => $r['author'],
'comment_content' => $r['content'],
'comment_type' => 'review',
'comment_approved' => 1,
'comment_date' => $r['date'] . ' 12:00:00',
'comment_meta' => ['rating' => $r['rating'], 'aliexpress_review_id' => $r['id']],
]);
}
WC_Comments::clear_transients($wc_product_id);Details worth getting right
- Keep the API key on the server. Run the import from PHP, WP-CLI or cron, never from JavaScript in the browser.
- Deduplicate. Store the AliExpress
idas comment meta and skip reviews you already imported. - Photos (
filter=image, Max plan): each review includes image URLs. Download them to the media library if you want to keep them if AliExpress removes them. - Refresh the rating. After a batch import, call
WC_Comments::clear_transients( $wc_product_id )so the average rating is recalculated.
Use them honestly
Label them as what they are: reviews of the product from AliExpress buyers, not from your customers. In the EU, consumer law requires you to say where your reviews come from, and being clear about it is also what builds trust.
Questions
Do the reviews show in the WooCommerce rating and schema markup?
Yes, if you create them as WooCommerce reviews (comments of type review with a rating), as in the example. They count in the average rating like any other review.
Can I schedule it to keep reviews up to date?
Yes. Run the script with WP-Cron or a server cron job, and skip the ids you already imported.
How many reviews can I get?
Up to 20 per request on Free and up to 100 on Pro and Max, with pagination to go through all of them. The quota is 100, 1,000 or 10,000 requests a day depending on the plan.
Is the API affiliated with AliExpress?
No. It returns the public reviews AliExpress shows on its product pages, but it is an independent service.
Try it with your own products
100 requests a day for free, no card required. Paste a product ID into the tester in your dashboard and see the JSON.