Title: WordPress Rest Api Issue With Images
Last modified: April 10, 2020

---

# WordPress Rest Api Issue With Images

 *  Resolved [raydh188](https://wordpress.org/support/users/raydh188/)
 * (@raydh188)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/)
 * Hi,
 * Im having issues to integrat WordPress rest api becouse of bad json output. Whenever
   i try to format and validate my json it gives me this error :
 * Error: Parse error on line 778:
    …t”: { “rendered”: “<p>Nj\u00eb nd\u00e ———————-
   ^ Expecting ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{‘, ‘[‘, got ‘undefined’
 * This is my json : [https://pastebin.com/29YUrtMK](https://pastebin.com/29YUrtMK)
 * Any help or idea what might be causing this ? 🙁

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

 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/#post-12659124)
 * [@raydh188](https://wordpress.org/support/users/raydh188/)
 * Something has gone wrong with the escaping of the content of post 78622, the 
   content has been split into 2 parts due to incorrect escaping of the `alt` parameter
   of an image inserted into the content – there is an escaping character before
   the `alt` parameter and the quotes are not appropriately escaped.
 * You may want to check that the image tag in that post is correctly formed in 
   the first place.
 *  Thread Starter [raydh188](https://wordpress.org/support/users/raydh188/)
 * (@raydh188)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/#post-12661417)
 * Hi [@mattyrob](https://wordpress.org/support/users/mattyrob/) , thanks for your
   response.
 * This is not the only json on my website that has errors in image alt tags. Any
   idea what might be causing this? Maybe becouse the alt of images are empty ?
   
   I can’t find any fix online
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/#post-12662289)
 * [@raydh188](https://wordpress.org/support/users/raydh188/)
 * It is likely coming from malformed content somewhere but as your theme contains
   errors itself it’s hard to see where it’s coming from – you have 2 lots of `<
   head>` tags for a start.
 * Have a look at fixing some of those errors:
 * [https://validator.w3.org/nu/?doc=https%3A%2F%2Fexit.al%2Fpa-testime-te-mjaftushme-qeverite-e-shqiperise-dhe-kosoves-po-deshtojne-ne-luften-kunder-koronavirusit%2F](https://validator.w3.org/nu/?doc=https%3A%2F%2Fexit.al%2Fpa-testime-te-mjaftushme-qeverite-e-shqiperise-dhe-kosoves-po-deshtojne-ne-luften-kunder-koronavirusit%2F)
 *  Thread Starter [raydh188](https://wordpress.org/support/users/raydh188/)
 * (@raydh188)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/#post-12663889)
 * hi mattyrob, i found and fixed the issue. Now the json response is valid. it 
   was the function that minify html and cleanup empty spaces.
 * –> It is likely coming from malformed content somewhere
    your response made my
   search the functions that i had in theme and many things it took me many hours
   but finally i found it 🙂
 * Thank you so much for your help

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

The topic ‘WordPress Rest Api Issue With Images’ is closed to new replies.

## Tags

 * [wordpress api](https://wordpress.org/support/topic-tag/wordpress-api/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [raydh188](https://wordpress.org/support/users/raydh188/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/wordpress-rest-api-issue-with-images/#post-12663889)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
