{"id":7108,"date":"2014-09-25T16:24:02","date_gmt":"2014-09-25T13:24:02","guid":{"rendered":"http:\/\/blog.belvg.com\/?p=7108"},"modified":"2025-07-01T09:13:55","modified_gmt":"2025-07-01T07:13:55","slug":"how-to-find-products-with-broken-images-in-prestashop","status":"publish","type":"post","link":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html","title":{"rendered":"How to Find Products with Broken Images in Prestashop"},"content":{"rendered":"\n<p>Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server. In such case users will see a gray question mark instead of a placeholder with the caption that the image for that product is not available.<!--more--><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"lazy aligncenter wp-image-10462 size-belvg-post-content\" src=\"https:\/\/belvg.com\/wp-content\/uploads\/2019\/06\/pixel.png\" data-src=\"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2014\/09\/How-to-Find-Products-with-Broken-Images-in-Prestashop-850x432.png\" alt=\"How to Find Products with Broken Images in Prestashop 850x432\" width=\"850\" height=\"432\" title=\"How to Find Products with Broken Images in Prestashop\"><\/p>\n<pre class=\"lang:php decode:true\">\/*prepare list of broken images*\/\r\nrequire(dirname(__FILE__).'\/config\/config.inc.php'); \/\/  you might need to change the path to the file 'config.inc.php' if you are not in the root folder\r\n$id_lang = 1; \/\/getting links for one language. This is enough to identify empty images\r\n$i = 0;\r\n$limit = 100;\r\n$filename = 'broken_urls.txt';\r\nfile_put_contents($filename, '', LOCK_EX); \/\/remove old content\r\n\/\/file_put_contents($filename, '', FILE_APPEND | LOCK_EX); \/\/append content\r\ndo {\r\n    $images = Db::getInstance()-&gt;executeS('\r\n        select *\r\n        from `'._DB_PREFIX_.'image` i\r\n        limit ' . (int)($i++ * $limit) . ', ' . (int)$limit . '\r\n    '); \/\/receiving the stack of images\r\n\r\n    foreach ($images as $image) {\r\n        $imgObj = new Image($image['id_image'], $id_lang);\r\n        $image_path = _PS_PROD_IMG_DIR_ . $imgObj-&gt;getImgPath() . '.' . $imgObj-&gt;image_format;\r\n        if (!file_exists($image_path)) { \/\/verifying, whether the file with the image exists\r\n            $productObj = new Product($image['id_product'], NULL, $id_lang); \/\/creating a product object for link generation\r\n\r\n            print_r($image['id_product'] . ' =&gt; ' . Context::getContext()-&gt;link-&gt;getImageLink($productObj-&gt;link_rewrite, $image['id_image']) . chr(10)); \/\/die;\r\n            file_put_contents($filename, $image['id_product'] . ' =&gt; ' . Context::getContext()-&gt;link-&gt;getImageLink($productObj-&gt;link_rewrite, $image['id_image']) . chr(10), FILE_APPEND | LOCK_EX);\r\n        }\r\n    }\r\n} while(count($images));<\/pre>\n<p>As a result we will have a file with the list of products on the screen. For such products you need to delete the entries in the table &lsquo;ps_im&#1072;ge&rsquo;, &lsquo;ps_im&#1072;ge_l&#1072;ng&rsquo; and &lsquo;ps_im&#1072;ge_sh&#1086;p&rsquo;, and upload images for these products again.<\/p>\n\n","protected":false},"excerpt":{"rendered":"Today we will explain how you can find products with empty images. By empty images &#8230;","protected":false},"author":12,"featured_media":9245,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_acf_changed":false,"footnotes":""},"categories":[15,34],"tags":[226,445,220],"class_list":["post-7108","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-prestashop","category-tipstricks","tag-images","tag-prestashop","tag-prestashop-tips","post_format-post-format-image"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Aliaksandr Simonchik\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#article\",\"name\":\"How to Find Products with Broken Images in Prestashop | BelVG Blog\",\"headline\":\"How to Find Products with Broken Images in Prestashop\",\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/alex-simonchik#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blog-broken-image1.jpg\",\"width\":682,\"height\":170},\"datePublished\":\"2014-09-25T16:24:02+02:00\",\"dateModified\":\"2025-07-01T09:13:55+02:00\",\"inLanguage\":\"en-US\",\"commentCount\":14,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#webpage\"},\"articleSection\":\"Prestashop, Tips&amp;Tricks, images, Prestashop, Prestashop tips, Image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"name\":\"Prestashop\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"position\":2,\"name\":\"Prestashop\",\"item\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#listItem\",\"name\":\"How to Find Products with Broken Images in Prestashop\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#listItem\",\"position\":3,\"name\":\"How to Find Products with Broken Images in Prestashop\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/category\\\/prestashop#listItem\",\"name\":\"Prestashop\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/alex-simonchik#author\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/alex-simonchik\",\"name\":\"Aliaksandr Simonchik\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6553917a81b1da7866b8b875368df6cbbec56413c3438694df8539de7fb092c0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Aliaksandr Simonchik\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#webpage\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html\",\"name\":\"How to Find Products with Broken Images in Prestashop | BelVG Blog\",\"description\":\"Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/alex-simonchik#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/author\\\/alex-simonchik#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/blog-broken-image1.jpg\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html\\\/#mainImage\",\"width\":682,\"height\":170},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/how-to-find-products-with-broken-images-in-prestashop.html#mainImage\"},\"datePublished\":\"2014-09-25T16:24:02+02:00\",\"dateModified\":\"2025-07-01T09:13:55+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/belvg.com\\\/blog\\\/\",\"name\":\"BelVG Blog\",\"description\":\"Magento and Prestashop articles\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/belvg.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Find Products with Broken Images in Prestashop | BelVG Blog","description":"Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server.","canonical_url":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#article","name":"How to Find Products with Broken Images in Prestashop | BelVG Blog","headline":"How to Find Products with Broken Images in Prestashop","author":{"@id":"https:\/\/belvg.com\/blog\/author\/alex-simonchik#author"},"publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2014\/09\/blog-broken-image1.jpg","width":682,"height":170},"datePublished":"2014-09-25T16:24:02+02:00","dateModified":"2025-07-01T09:13:55+02:00","inLanguage":"en-US","commentCount":14,"mainEntityOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#webpage"},"isPartOf":{"@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#webpage"},"articleSection":"Prestashop, Tips&amp;Tricks, images, Prestashop, Prestashop tips, Image"},{"@type":"BreadcrumbList","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/belvg.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","name":"Prestashop"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","position":2,"name":"Prestashop","item":"https:\/\/belvg.com\/blog\/category\/prestashop","nextItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#listItem","name":"How to Find Products with Broken Images in Prestashop"},"previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#listItem","position":3,"name":"How to Find Products with Broken Images in Prestashop","previousItem":{"@type":"ListItem","@id":"https:\/\/belvg.com\/blog\/category\/prestashop#listItem","name":"Prestashop"}}]},{"@type":"Organization","@id":"https:\/\/belvg.com\/blog\/#organization","name":"BelVG Blog","description":"Magento and Prestashop articles","url":"https:\/\/belvg.com\/blog\/"},{"@type":"Person","@id":"https:\/\/belvg.com\/blog\/author\/alex-simonchik#author","url":"https:\/\/belvg.com\/blog\/author\/alex-simonchik","name":"Aliaksandr Simonchik","image":{"@type":"ImageObject","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/6553917a81b1da7866b8b875368df6cbbec56413c3438694df8539de7fb092c0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Aliaksandr Simonchik"}},{"@type":"WebPage","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#webpage","url":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html","name":"How to Find Products with Broken Images in Prestashop | BelVG Blog","description":"Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/belvg.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#breadcrumblist"},"author":{"@id":"https:\/\/belvg.com\/blog\/author\/alex-simonchik#author"},"creator":{"@id":"https:\/\/belvg.com\/blog\/author\/alex-simonchik#author"},"image":{"@type":"ImageObject","url":"https:\/\/belvg.com\/blog\/wp-content\/uploads\/2014\/09\/blog-broken-image1.jpg","@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html\/#mainImage","width":682,"height":170},"primaryImageOfPage":{"@id":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html#mainImage"},"datePublished":"2014-09-25T16:24:02+02:00","dateModified":"2025-07-01T09:13:55+02:00"},{"@type":"WebSite","@id":"https:\/\/belvg.com\/blog\/#website","url":"https:\/\/belvg.com\/blog\/","name":"BelVG Blog","description":"Magento and Prestashop articles","inLanguage":"en-US","publisher":{"@id":"https:\/\/belvg.com\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"7108","title":"How to Find Products with Broken Images in Prestashop | #site_title","description":"Today we will explain how you can find products with empty images. By empty images we imply those pictures, which are indexed in the database, but the files are not physically located on the server.","keywords":null,"keyphrases":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-11-03 18:37:58","updated":"2026-11-03 18:37:58"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/belvg.com\/blog\/category\/prestashop\" title=\"Prestashop\">Prestashop<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Find Products with Broken Images in Prestashop\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/belvg.com\/blog\/"},{"label":"Prestashop","link":"https:\/\/belvg.com\/blog\/category\/prestashop"},{"label":"How to Find Products with Broken Images in Prestashop","link":"https:\/\/belvg.com\/blog\/how-to-find-products-with-broken-images-in-prestashop.html"}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/7108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/comments?post=7108"}],"version-history":[{"count":-2,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/posts\/7108\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media\/9245"}],"wp:attachment":[{"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/media?parent=7108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/categories?post=7108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/belvg.com\/blog\/wp-json\/wp\/v2\/tags?post=7108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}