If you want to update title and description you should not use wp_update_attachment_metadata attachment title and description is not a meta it’s a main post detail (attachment is custom post), you can do this with following code.
$attachment = array(
'ID' => $id,
'post_title' => $title,
'post_content' => $description
);
// now update main post body
wp_update_post( $attachment );
Related Posts:
- delete attachment for one post without deleting actual attachment post
- Why this plugin doesn’t work with media upload page?
- How to check an ajax nonce in PHP
- Long Polling: Stuck in while loop
- How to update Comment post meta through an Ajax call
- Attach time/date stamp on add_post_meta
- bulk update meta value with ajax
- Update status, meta while inside a post using AJAX button
- i’m trying to get all my media query attachments via ajax in wordpress
- Filter images from media library by guid meta field
- Frontend AJAX Media Upload returning 404
- Want to send ajax request in wordpress to a custom file in plugin
- delete post meta data in array WordPress
- Allow guest to update custom post met using ajax
- Data from ajax not updating post meta
- jQuery’s .on() method combined with the submit event
- Why use admin-ajax.php and how does it work?
- Why is die() used at the end of function that handles an Ajax request?
- Making my AJAX powered WordPress Crawlable
- WordPress Ajax Data Security
- admin-ajax.php doesn’t work when using POST data and Axios
- Custom Form with Ajax
- How is it possible that the function of the test page works, but it does not go live?
- jQuery Autocomplete not working with wp_localize_script
- ajax delete value from custom field array
- WP REST API route request explain
- Adding meta data to an attachment post
- How to get custom field image url of specific size
- Ajax returning correct data BUT at wrong place
- admin-ajax.php mixed content
- WP-API and Basic Auth returning 403 on POST but not GET
- Call javascript function when category was added via ajax
- json encode not work in wordpress
- Ajax in plugin settings page returns 400 Bad Request
- Admin-Ajax Error
- WordPress Ajaxify Problem with Scroll-to [closed]
- Stop ajax listener from sending empty parameter to function
- infinite-scroll for 2 fixed height containers
- How to update the title of audio file through its attachment metadata
- is_single() conditional check inside ajax php function
- How to make registration form ajax?
- Specify ABSPATH in jQuery url
- WordPress action – Pass arguments into action in an AJAX call?
- 403 error When i send ajax request on WordPress website
- Ajax Call 400 Bad Request error with POST request but not with GET request
- While Ajax is working well, media upload isn’t showing the imagines
- How can I call an api before user login
- Problems with wordpress nonces in Ajax call
- Full Front End, AJAX comment system and comment reply script
- why does not work ajax that add_action registered in wordpress
- How to get post from pure frontend AJAX (using only post ID)?
- Auto load subcategories content with ajax
- Multiple AJAX requests using the same ajax_object.ajaxurl
- Is there a better way to access transients using javascript
- Filter custom post types by custom field using AJAX
- Refresh loop of custom posts (div) after new post is published
- Use ajax request to load sidebar
- How to detect if the ajax_query_attachments_args was triggered to set the featured image?
- WordPress ajax response save into database
- How to change request URL?
- Why the wp_localize_script() does not work correct in my case? ( /wp-admin/admin-ajax.php 400 (Bad Request) )
- Zip Files from custom fields
- Prevent AJAX caching from plugin
- Should wordpress nonce be placed in html form or in javascript file
- how to make sure js is enabled before executing php function
- ERROR while passing data from JS to PHP via AJAX
- ajax load more instead of pagination
- jQuery AJAX url wit variable
- Unable to delete attached file from folder programmatically
- How to pass array from jQuery to PHP with AJAX in WordPress?
- Using existing ajax data that is loaded into page
- Ajax call works for logged in users and returns “Bad Request” for guests [duplicate]
- Attachment metadata has value of ‘1’
- On form submitting, admin-ajax.php shows status as pending
- How to force the admin-ajax.php file to load over HTTPS?
- Unable to ajax request with meta_query
- get_body_class() in ajax envrionment
- Ajax WordPress pass post URLs
- How To Pass Theme Path In Javascript Ajax to Pass Id On another Page in WordPress Custom Page Template?
- Infinite Scroll
- Session variables lost during Ajax calls – WordPress – Sage Starter Theme
- While doing ajax, WordPress returning internal server error 500 and stating that my theme functions are undefined
- SHORTINIT and sessions
- How to use AJAX to check if user is still logged-in?
- Closing ajax function file with die() causes error and empty page
- How to load wordpress sidebar using AJAX [duplicate]
- using Ajax: call to undefined function get_option
- WordPress Pagination with ajax – Dots
- Bad Request when adding new post via ajax form
- How To Pass Ajax Value to PHP Query?
- Ajax load more posts button
- ajax for visitors wordpress
- PHP cookie not set within AJAX call
- WordPress Ajax send response on every iteration of a loop
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- Access to a data from a response AJAX called in a template file php
- Escaping admin_url output being passed to js (esc_js vs esc_url)
- wp-admin/admin-ajax.php 400 Bad request (chrome console)
- WordPress send Ajax where click button
- contact form 7 form not working in admin panel