Title: samsup's Replies | WordPress.org

---

# samsup

  [  ](https://wordpress.org/support/users/samsup/)

 *   [Profile](https://wordpress.org/support/users/samsup/)
 *   [Topics Started](https://wordpress.org/support/users/samsup/topics/)
 *   [Replies Created](https://wordpress.org/support/users/samsup/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/samsup/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/samsup/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/samsup/engagements/)
 *   [Favorites](https://wordpress.org/support/users/samsup/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Import and export users and customers] PLugin forcing user to wp-admin/profile.php](https://wordpress.org/support/topic/plugin-forcing-user-to-wp-admin-profile-php/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/plugin-forcing-user-to-wp-admin-profile-php/#post-16372631)
 * Thank you, the reset fixed it.
 * I was puzzled because I did have the password reset for the account done, even
   requested a new password by the ” lost password” function, so didnt figure that
   it would still be hung up on the initial forced password reset!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15647095)
 * Hello,
 * Yes thank you all for the information and help. The result is different than 
   expected at first, but essentially it all works. It would be good to explain 
   the mechanics of images a bit more deeply in the API documentation maybe, as 
   I would imagine more people are strugling to grasp how the library does its magic.
 * But long story short, picture update via API works, however the JSON response
   is not going to be the image link ( which is what I expected) but it is rather
   going to be the newly created imagelink in the medialibrary.
 * The only thing that I could not get to work is to update an image ( overwrite
   in the library) using the imageID, so I am stuck at just creating new images,
   but perhaps that is not thet intended fuction of the API ( hence it would be 
   good to more deeply explain the documentation here).
 * As for creating endless duplicates, it is not optimal, but easily manageable 
   with a plugin that sanitizes unused images.
 * so on my end, I was able to do everything I needed to do!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15625760)
 * Mirko, your suggestion works, partially. I can in fact confirm that I can now
   modify images when not using the imageID.
 * This however creates the problem that the media library keeps generating new 
   images every time I do an API call ( so by now I have for product 0260101, I 
   have 0260101.jpg, 0260101-2.jpg, 0260101-3.jpg, 0260101-4.jpg, which are all 
   4 copies of the same image ( for the 4 PUT requests I did) When I change the 
   image to for example 0260101test.jpg, it creates that image, and when I PUT it
   agian, it creates another 0260101test-1.jpg for example.
    This would ofcourse
   overflow my server after a few iterations of doing this.
 * From what I read in other topics regarding images and API, the solution to that
   would be to include the imageID.. but when I include imageID, I am not able to
   update/change the image at all, wether it has same filename, or new filename 
   to an existing image in the library.
 * I tried using DELETE call with the image but that just trashes the whole product..
   so thats a no go..
 * so essentially whats left is to find a way to remove the entire picture library
   every time I want to mass update images? There must be a more “correct” way to
   remove unused images right?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15622159)
 * Hi Mirko,
 * I am doing the exact same thing, as far as I can tell..
    below image of what 
   I am doing
 * [https://snipboard.io/G4v3IQ.jpg](https://snipboard.io/G4v3IQ.jpg)
 * The response keeps giving back the old link location. I have tried above with
   Put, Patch and Post, all give the same response. I can update any value in the
   product Json, except for the image link.. Is there some setting somewhere that
   might be causing the change of images to become impossible? Either in the server
   settings, woocommerce or wordpress settings?
    -  This reply was modified 4 years, 1 month ago by [samsup](https://wordpress.org/support/users/samsup/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15620003)
 * I can by the way also confirm that I have tried to do the request without the
   read only datapoints of ` “date_created”: “2021-06-30T13:02:27”,
    “date_created_gmt”:“
   2021-06-30T13:02:27”, “date_modified”: “2022-05-05T17:32:26”, “date_modified_gmt”:“
   2022-05-05T17:32:26”,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15619385)
 * Hi Mirko,
 * Thank you for the suggestion. I must have made a typo when redacting the link,
   but I can confirm that I have been doing the put request with the correct double
   quote..
 *     ```
                "images": [
               {
                   "id": 20435,
                   "date_created": "2021-06-30T13:02:27",
                   "date_created_gmt": "2021-06-30T13:02:27",
                   "date_modified": "2021-07-11T13:14:19",
                   "date_modified_gmt": "2021-07-11T13:14:19",
                   "src": "https://www.https://samsup.com/images/0260101.jpg",
                   "name": "test",
                   "alt": "test "}],
       ```
   
 * it returns:
 *     ```
       "images": [
               {
                   "id": 20435,
                   "date_created": "2021-06-30T13:02:27",
                   "date_created_gmt": "2021-06-30T13:02:27",
                   "date_modified": "2022-05-05T17:32:26",
                   "date_modified_gmt": "2022-05-05T17:32:26",
                   "src": "https://www.samsup.com/wp-content/uploads/2021/06/0260101.jpg",
                   "name": "test",
                   "alt": "test"
               }
           ],
       ```
   
    -  This reply was modified 4 years, 1 month ago by [samsup](https://wordpress.org/support/users/samsup/).
    -  This reply was modified 4 years, 1 month ago by [samsup](https://wordpress.org/support/users/samsup/).
    -  This reply was modified 4 years, 1 month ago by [samsup](https://wordpress.org/support/users/samsup/).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] REST API not updating image link](https://wordpress.org/support/topic/rest-api-not-updating-image-link/)
 *  Thread Starter [samsup](https://wordpress.org/support/users/samsup/)
 * (@samsup)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/rest-api-not-updating-image-link/#post-15619034)
 * Okay so an update to this issue I am running into;
 * I can modify image name, and altname via the postman PUT command. I have been
   succesfull in updating various other arrays too. The only thing at this point
   not working is updating the image “src” link. Whenever I drop a paypload it will
   update all fields fine, just not the image “src” ones. It gives status 200, so
   no errors.
 * Unless there is another way this should be done..simply dropping the files in
   with FTP clearly doesnt work to bulk replace images, and linking each image separately
   by hand is not an option with over 4000 products to update. My idea was to have
   a little script in my database program crawl trough each product and just update
   the image source link in woocommerce by using the REST API to link to the new
   image ( image is present on the server, accesible via http), and hoped that woocommerce
   would be able to pick that up.. but this seems to be impossible too. Also failing
   to add a second picture by just uploading the “src” imagelink without imageID(
   from what I gather it should then create a second image)
    I have tried to find
   more correct methods of mass updating images in woocommerce, but have been unsucessfull
   in finding somethhing that works for us.

Viewing 7 replies - 1 through 7 (of 7 total)