Questions tagged [media]

An image, audio or a video comprises a media.

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete

I am trying to write a plugin that adds a custom meta field to image attachments to give images a credit field. I use the 'attachment_fields_to_edit' and 'attachment_fields_to_save' filters. ...
0 votes
1 answer
953 views

How to split my uploaded media into directories?

I am reading the documentation of WordPress Media Library and it seems to me that it doesn't allow me to split my uploaded media into directories. Is it true? Why this choice? How can I implement ...
0 votes
3 answers
1k views

Multisite has SSL certificate, but media library is still http://

Our multisite WordPress installation has a URL of https://xx.com for the main domain, and - for example, https://yy.xx.com as a subsite. We're using WP's in-built domain mapping feature. Media ...
1 vote
2 answers
2k views

What is the alternative to `<?php the_content(); ?>` when it comes to calling Media (image) files in the 'attachment.php' file?

I am in the process of putting together my own WordPress Theme. Up until now, I have been using the 'single.php' file to act as a Template for both my Blogs and Media Files. In reference to my Media ...
2 votes
1 answer
58 views

Bulk image importing from folders

I have hundreds of different named folders with various amounts of images inside each. I uploaded the folders to the wp-content/uploads directory. How can I import all at once into the media library (...
1 vote
0 answers
13 views

Updating a remote media library plugin, wich breaks on php 8.1 update [closed]

We use the (now abandonware) plugin Remote media libary, with the Flickr add-on. It allows the user to see the wordpress photos and albums in the media library. https://wordpress.org/plugins/remote-...
0 votes
1 answer
25 views

Can not access .txt file which I uploaded through media

I can not access my uploaded .txt in Wordpress, it gives a 403 access denied error. I can access .png files however, why not .txt files? I uploaded my file here: And got the URL here (I click copy, ...
2 votes
2 answers
5k views

How To install AWS SDK for PHP in wordpress?

I am going to install and use AWS SDK for PHP to facilitate uploads/list objects directly from the front-end of my WordPress instance to S3. What is the best practice to do that ? P.S: I don't want ...
3 votes
1 answer
1k views

Restrict file types in the uploader of a wp.media frame

When creating a wp.media frame in JS, is it possible to specify allowed file types for the uploads tab? wp.media({ title: 'Pick a PDF', button: { text: 'Use this file...' }, ...
0 votes
5 answers
8k views

Media Library is not loading on grid view in admin panel

Media Library is not loading on grid view and also featured image not select any image from post and page . The progress circle keeps spinning. Due to this issue, I am not able to add any image in the ...
0 votes
0 answers
20 views

I have uploaded thousands of files in the uploads folder via FTP and I want to register them into the database without any plugin

I have uploaded thousands of files in the uploads folder via FTP and I want to register them into the database without any plugin because plugin takes so much time. Is there any way to register them ...
0 votes
1 answer
1k views

How to create different media uploader frames / filter library depending on a custom action

Here is the thing. I am using the WP media uploader on the frontend. What I need is to have it behave differently depending on a certain action. I am attaching the media in a specific custom post ...
1 vote
0 answers
17 views

How to revert the media structure from /uploads/year/month to the /uploads directory in wordpress?

I tried to use wp-cli using regex like this: wp search-replace 'uploads/[0-9]+/[0-9]+/' 'uploads/' --all-tables --regex but in this case there is a problem with possibly repeated file names and ...
1 vote
1 answer
55 views

Convert base64 string to WordPress attachment uploads multiple images instead of a single one

I'm trying to convert a base64 string to an image file and upload it into WordPress media library. It seems like the code is working, but, for some reason, every time I call this function it uploads ...
0 votes
1 answer
1k views

Disable wordpress gif compression?

Is it possible to disable the default gif compression in Wordpress. I'm uploading animated gifs and they are turning soft. Any advice much appreciated. Attached is a screen grab illustrating the ...
0 votes
1 answer
727 views

How to display the Media Library Items Upload date

I have a product image catalogue and i'd like to display the Uploaded date of the image: I can see on the media library it displays on-top of the item: Uploaded on: April 15, 2021 as an exmaple but ...
0 votes
1 answer
974 views

MP4 file links download instead of playing

How can I make MP4 file download the file instead of playing it on wordpress?
0 votes
1 answer
1k views

Images not loading on webpage, and links to other media give 404 Not Found

Had some recent problems where to start with only homepage text was visible, all other pages/links gave 404 Not Found. Now managed to get pages to function but all images fail to load, plus links to ...
0 votes
1 answer
54 views

stop resize button for wordpress media

The images in my WooCommerce product gallery do not need to be resized I only need the original image to display. Is there a way to add a toggle button to wordpress media to tell it to generate other ...
3 votes
3 answers
2k views

Retrieving JSON data in ajax request from media uploader

I'm having some problems getting my JSON data that's being passed via an ajax request. I'm trying to implement the media uploader into a plugins settings page. I've got it functioning properly using ...
0 votes
1 answer
1k views

Hide download button from audio player

[embed width="28"]http://audio.itunes.apple.com/apple-assets-us-std-000001/AudioPreview91/v4/e7/e0/fb/e7e0fbfb-5582-ee65-6a81-823b5ecf9186/mzaf_5076836927047056840.plus.aac.p.m4a[/embed] Since ...
0 votes
1 answer
16 views

How to prevent wordpress from redirecting media attachment page to media page?

For some reason googlebot tried to index my media attachment pages and got redirected to media pages. This seems to be a default wordpress behavior. To recreate it, upload an image called test.jpg to ...
1 vote
1 answer
671 views

Custom dropdown field added to media gallery; how to get it to save properly?

I am using the following code to add a couple of custom fields to media attachments: //Add custom fields for attachments function kgal_add_custom_fields_to_artwork( $form_fields, $post ) { $...
3 votes
1 answer
1k views

How to disable drag-and-drop upload function in Media Library?

Does any one knows a valid/standard way to disable drag and upload when accessing the media library in the admin area? In order to make this sense to you, I'm building a multisite and user of sub-site ...
3 votes
3 answers
3k views

How to automatically convert images to WebP on WordPress?

I want to convert every PNG and JPEG to WebP on upload so that I can serve WebP and PNG/JPEG without requiring the user to upload a WebP version of every photo. I want to save the WebP in the same ...
0 votes
1 answer
678 views

Media Library Mess After FTP ... /uploads

I've got a Media Library mess on my hands. Transferred old site to staging server for redesign and uploaded large .../content/uploads via FTP after I was unsuccessful in importing media files thru the ...
0 votes
2 answers
1k views

upload image with rest API to the media library

I am working on uploading an image to the media library and then attaching it to the featured image. I put the code below in my functions.php file and submitted a JSON file through postman, but for ...
1 vote
2 answers
980 views

It is possible to add custom media size in admin media edit?

Hi! It is possible without plugin to add ability edit custom thumbnail image size and apply changes to it?
0 votes
1 answer
3k views

Media and all images disappeared from my wordpress site

I only added a plugin call WPFreshstart 5 to my site and later when I went into my site I noticed all media library was gone and all images thru out my site were gone even the widget area. I deleted ...
0 votes
2 answers
705 views

Missing a temporary folder not fixed

I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum: define('...
1 vote
1 answer
933 views

Is it possible to use media_sideload_image to upload local files?

I want to add media_sideload_image to upload a file programmatically . I've got it working when the image URL is online (e.g. http://etc...) but not when it's a local file from my hardrive or network ...
0 votes
2 answers
2k views

Direct media library upload saving in wrong month date folder in custom theme

I have an issue in my custom theme. Direct media library upload saving in wrong month date folder (2017/03) when current date is 2018/09. But when I upload images through post it goes to the correct ...
1 vote
2 answers
1k views

Restrict WordPress Media Library for a specific user role (users can only see/select own media)

I have 4 roles in my platform : administrator, author, editor, external I need to restrict WordPress media library access to the user’s own uploads only for one users role (external) on my platform. ...
0 votes
1 answer
29 views

Media Library Issues

(All plugins disabled) I have some strange issues with the media library. It's an old site that I have been managing for the last 2 years. The site has dated media folders on disk going back to /2010/...
0 votes
1 answer
896 views

Only current gallery images with get_attached_media

On my page the gallery images are cycled and I would like to show their title as a caption. Since get_post_gallery_images only retrieves the thumbnail-url of the gallery images I have tried to use ...
0 votes
1 answer
712 views

Import media in bulk with caption and titles?

I am converting a non-WP site to a new WP site. The old site has about 500 images that I need to import to the media library in bulk, and I need it to include the captions and titles. Is there an ...
0 votes
1 answer
366 views

Uploading media to wordpress API with C# HttpClient

I was trying to save some media but I can't get it to work. I don't know if its the authorization is the wrong format, or if its the content is just put in wrong. If someone knows how to please help ...
0 votes
1 answer
33 views

Different upload file size limits based on file type

I would like to put a different limitation on uploading content in the media library ( depending on file size and file type) For example : Upload mp4 (allow maximum upload file size 64mo) Upload pdf (...
0 votes
1 answer
679 views

Admin Ajax returns "0 200 OK server error.." in Multi-site sub-site

I'm aware admin-ajax.php is intended to return '0' if there's no action set. My issue seems to be that it's returning an error after the '0'. Accessing the file mu.site.com/wp-admin/admn-ajax.php ...
2 votes
1 answer
6k views

How do I get images (with a thumbnail preview) to show in search results?

The Short Version I've constructed a Wordpress site (Gazette theme base) with lots of image media. All have descriptions, captions, and titles but do not show up in search results; using Relevanssi I ...
1 vote
2 answers
749 views

Wordpress uploads autocreate folder every month

In start of every month WP creating folder with month number, like /uploads/2019/11, and it's creating with ROOT, so I dont have permission to write it. If I delete it, and then it's creating when I ...
0 votes
1 answer
2k views

Get all uploaded images using REST api

I need to get all the images that are uploaded in my wordpress installation using the REST API. I've tried using the wp-json/wp/v2/media endpoint but it will give me only the last 10 images uploaded ...
0 votes
1 answer
18 views

audio tags no longer working

On my website, I had a plugin, that displayed a media tag like [audio src=path/file.mp3]. It returned this tag in the HTML retruned from the shortcode function. function init() { add_shortcode('...
0 votes
1 answer
116 views

Replace media external links with local links

I use an automatic post importer in WordPress and add the images in post content with the external URL, I want to replace the link with the local site links. DB function could do the trick. eg: ...
1 vote
1 answer
18 views

wp-content/uploads/year/month returns 404

I have a litespeed hosting I have disabled all plugins and all wordpress related htaccess rewrites. If I go to https://digitalzoomstudio.net/wp-content/uploads/2023/ - then I can see the directory ...
0 votes
0 answers
15 views

images inside uploads folder will return 404

My images will not load . accessing anything inside the uploads folder returns 404 https://digitalzoomstudio.net/wp-content/uploads/2022/11/image-1-1024x617.png I am 99% sure I am not crazy and that ...
0 votes
2 answers
819 views

how can I change all wordpress media file url to custom cdn url?

any function can apply change all image URLs to CDN instead of modifying media.php in wp-includes folder ?
0 votes
0 answers
45 views

Undefined array key "width" in wp-admin/includes/image.php error when publishing post or page

When publishing a post or page that includes trusted SVG files in the content, WordPress spits out the errors Undefined array key "width" in wp-admin/includes/image.php and Undefined array ...
0 votes
2 answers
2k views

Hook into backbone to add js to wp-admin -> media library?

I've enqueued a .js file on the "Media Library" page (upload.php). I need to hide and manipulate a few of the thumbnails on the page using JS only ( I'm not looking for workarounds ). The elements ...
0 votes
1 answer
813 views

Bulk Attach Or Insert Media To Post Without Opening Post Editor

How to create a custom panel inside wp admin dashboard where we can insert media to specified posts in bulk? Here is the illustration: As shown on the image above, it list all available media on the ...

1
2 3 4 5
22