Questions tagged [media-library]
Media Library is a WordPress panel that display all files you've uploaded. There you can add new files, attach files to posts and pages etc.
977 questions
0
votes
0
answers
128
views
Why is Wordpress creating duplicate images on export / import of media library?
Hi I am using the standard Wordpress import/export tool to try to copy my media library to another WP instance. I export selecting only the media. I download the XML file. I import it to the new WP ...
1
vote
1
answer
72
views
Sharing media files between live and staging servers
It would be great if we didn't have to move media files around all the time. Is there a way to share the live site's media library with the staging server?
I've tried change the option upload_path but ...
-1
votes
1
answer
304
views
Adding a folder to word press Media Library
Why isn;t there an "Add Folder" or an "Add Directory" function available on the Media Library page in WordPress? I found this:
https://devowl.io/wordpress/media-library-create-...
0
votes
0
answers
44
views
Additional Images in Media Folder after importing products from CSV to WooCommerce
I exported 1600 WooCommerce products to a CSV file and after importing it to another site, I have 57,000 images in my uploads folder with different sizes and 2.5 GB in size. In fact, each image has 16 ...
0
votes
0
answers
101
views
Will WP-CLI "wp media regenerate" delete the changed thumbnail sizes by default?
I have have a site with 180,000 images. Most were added via SFTP and then added to the Media Library with the Add from Server plugin (which creates the image post and generates the WP and theme ...
0
votes
0
answers
26
views
Wordpress Media Library can't see compressed images
I use the plugin to convert jpg/png to Webp like Webp Express.
But the Media Library can't see compressed images.
It shows only original images.
How to make the Media Library show the compressed ...
0
votes
1
answer
64
views
Why is the change in my query not taking into account
I'm using 'pre_get_posts' action to filter the media so authors only see those uploaded by them or other authors. I managed to get the right result in the media page with this code
add_action( '...
0
votes
0
answers
52
views
Display image sizes in media library and make it sortable
I've used this code https://wordpress.stackexchange.com/a/296517/254438 to add image sizes in media library.
How do I add sorting of image sizes? I know there are plugins but I don't want to use any ...
0
votes
1
answer
96
views
Media Library it doesn't show any of the uploaded images after updating wordpress 6.6.2
I have this problem since wordpress was automatically updated by whm/wp-toolkit.
I continued to use the "Media Sync" plugin to return the images to the "Media Library" and it works....
0
votes
0
answers
47
views
PSD File Upload - Media Library not Displaying Thumbnail
I've managed to modify WP so it allows .ai and .psd uploads using the following code:
add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes = array() ) {
...
0
votes
0
answers
47
views
How to save Wordpress post and attachment images from front end using media library?
I'm developing a wordpress page to submit a post and its images attachment. I don't use input type="file" instead use jQuery wordpress media library.
frame.on("select", function (...
0
votes
0
answers
79
views
add_attachment hook not firing on certain devices
I am developing a plugin for a client, and we are using the add_attachment hook to extract metadata from the images that we process as part of the plugin.
The funny thing is that the hook successfully ...
1
vote
1
answer
182
views
Convert entire media library to WebP, delete original images and update references
I am in the process of revamping an existing site. The process I wish to follow is to start with a new clean site, then export/import posts and images in batches from the old site to the new. In the ...
2
votes
0
answers
60
views
I can't see all images in my media library - How Can I reset the index of that library?
When I load my media library (either through the media tab on the left or editing posts/pages and adding images in that interface) it shows that I have 1206 images in my site. However when I click ...
0
votes
2
answers
3k
views
Cannot Upload Video (MP4) File
It's a 28.8 M .mp4 file that has uploaded to another WP installation and is live. I'm trying to use the same file on a development server - a fresh install of WP with a media upload limit of 512M. ...
0
votes
0
answers
286
views
"Media Library" shows as empty, despite images being present
I am trying to clone a WordPress site, but the files in wp-content/uploads aren't shown in the the Media Library:
OK: I have created a new subdomain for a new installation of WordPress, and I have ...
3
votes
1
answer
169
views
WordPress Permissions Issue for Media Library / uploading
I've got some issues with file permissions which I'm trying to resolve...
I have two sites and they both have the same permissions as far as I can tell but for some reason one site can upload files / ...
0
votes
0
answers
80
views
Why are PDF thumbnails over-saturated?
Often then colors of PDF thumbnails generated by Wordpress are wrong, they look over saturated.
Is there something I can do to correct that, or is that caused by the PDF itself ?
1
vote
1
answer
73
views
Ajax response from Media Selection does not update ALL information more than once
I don't quite know how to explain what is going on, or how to title my post but I'm going to do my best.
I'm making my first plugin for WordPress, which is very simple.
Allow the user to select a file ...
1
vote
1
answer
628
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
68
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/...
1
vote
1
answer
151
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
0
answers
120
views
How to change media folder from created time of the post to publish date?
Now, all the structure of the media folder is under /wp-content/uploads/ and years-months combination from the created date of the post.
Is it possible that his path will automatically change to /wp-...
0
votes
2
answers
214
views
Removing filename searches when searching attachments
My website's db is quite big. I have some 350,000 images in the media library (as well as some 350,000 posts). My wp_postmeta table has 4,580,552 rows.
As a result, some queries are insanely slow and ...
0
votes
1
answer
100
views
Does Wordpress Super User or Administrators can create and edit post and media on behalf of a user
For my project I need to administrate user post and media without access to it personal account.
So I must be able to create and edit a post (by is user name) before or after it has been created on ...
0
votes
1
answer
111
views
Unable to upload media files: Maximum upload file size: 0 B [closed]
All of sudden I am seeing the above. php.ini already have the following lines:
post_max_size = 1024M
upload_max_filesize = 1024M
1
vote
1
answer
202
views
How do you detect when an image has been deleted from WordPress media library?
I want to detect when the user click "Delete permanently" in media library so that I can use the post ID of said image to remove the image from my plugin. I have the below code, but it's not ...
0
votes
1
answer
133
views
Detach Wordpress Media Files In Bulk
Just switched WP themes and I have about 1300 media files attached to what Wordpress is calling a 'Private Post'.
These Private Posts are actually photo portfolios from the previous theme. 200 ...
0
votes
1
answer
209
views
Wordpress Media Uploader not displaying image that has just been uploaded
I am trying to implement a custom WP Media uploader within a plugin. I want multiple images to be uploaded also.
I have the following javascript to open the media uploader. The modal opens fine and ...
0
votes
1
answer
201
views
Is there a way to override only a portion of the function print_media_templates defined in wp-includes\media-template.php?
I'd just like to -safely- change the visual presentation on the Attachments pop-up window, ie. move some of the main DIVs around. But it seems like the only hook is to the entire function which is ...
0
votes
1
answer
41
views
Media manager asks for file title when upload
When I upload a new file I have this error message : Content, title, and excerpt are empty.
I found the error messahe in wordpress_data/wp-content/languages/en_GB.po line 6809 (but it's a post related ...
0
votes
1
answer
59
views
Add URL in image upload error message
I'm wanting to add a URL link into the image upload error message, but it's only printing the string, not adding the hyperlink. I'm using the code below
function my_max_image_size( $file ) {
$...
2
votes
0
answers
108
views
Is there any halfway decent documentation on the wp.media JS class?
Sorry for the somewhat rambly question, but has anyone ever seen any good piece of documentation, or maybe even a tutorial on the wp.media JS class?
All that i could find documentation-wise is this ...
4
votes
1
answer
245
views
How can I add custom sizes for PDF thumbnails generation?
I define custom image sizes in my theme like this :
add_action( 'after_setup_theme', 'mwm_custom_image_sizes' );
function mwm_custom_image_sizes() {
add_theme_support( 'post-thumbnails' );
...
0
votes
1
answer
319
views
Files showing in link but cannot be found in the upload directory
https://fleurdelys.nl/wp-content/uploads/2018/04/legle-sous-le-soleil-5-100x100.jpg
I have this file that really shows up in the browser. If i check the upload directory it can noyt befound in the ...
0
votes
1
answer
963
views
What is the proper use of guid for images in wp_posts?
I understand that guid is a unique reference for a post, whether that post is a post or an attachment.
When it's a post, I think guid is self-evident. But what is the correct formulation/destination ...
0
votes
1
answer
259
views
Assign multiple categories to Media Library upload
I want to be able to upload files and either immediately or after upload assign multiple categories to them. I have 3 different kinds of PDF document: Treasurer report, minutes, and newsletter. What I ...
0
votes
2
answers
936
views
Media library upload hook
I would like to create a function that fires when a file is uploaded to media library to automatically assign multiple categories. So I created this code as proof of concept, but it is not assigning a ...
0
votes
0
answers
507
views
Block non logged in users from accessing the media library
I have a custom login page for a site I'm working on that isn't related to the backend login. The purpose of this is so users that aren't logged in cannot see the site. When the site loads it looks ...
1
vote
0
answers
68
views
upload image to wordpress media library failed for custom post type
image upload failed. I tried to upload gym logo as thumbnail image for gym post type. All the form elements are working. But image upload is not working. images are not appearing in WordPress media ...
0
votes
1
answer
297
views
wp cli media commands not working
I am trying to bulk update media file captions through WP CLI so i can attribute image creators.
My command is as follows:
wp media list --date="2022-02-24" --format=ids | xargs -n 1 wp ...
0
votes
1
answer
520
views
Image in binary in the data to WordPress media library
A specific API, returns an image in binary in the data.
If I need to save it to the server, I can easily do it by following the code.
$response = curl_exec($curl); // This is the API response
...
0
votes
1
answer
3k
views
Many images in wp-content/uploads folder that are not in Media Library
I think my database must be out of sync, or something. I checked the wp-content/uploads folder in my Bluehost File Manager and I have many more folders and files than I see in the Media Libary.
I also ...
0
votes
0
answers
360
views
How can I change the page title of PDFs opened from a WordPress link which use the browser's viewer?
When you open a Media page and click the link to open an attached PDF, it uses the browser's own code to generate the HTML wrapper. And the HTML title is extracted from the PDF.
We have many documents ...
0
votes
0
answers
411
views
How to bulk edit taxonomies for attachments
I am looking for a way to bulk edit taxonomies for the attachment post type (basically, for images).
I needed to categorize a large Media Library, therefore I added a custom taxonomy by using "...
0
votes
1
answer
837
views
Upload to a specific media folder created by FileBird Lite
I have an import that runs in the background of my server through cron. I have a plugin called FileBird Lite (https://ninjateam.org/wordpress-media-library-folders/) that helps create folders and such ...
0
votes
1
answer
26
views
Wordpress Multisite Medial Library not working for .online domain
I have a wordpress multisite domain setup (subdirectory setup) and all the domains have been working fine (all end in .com). I've recently added a domain ending in .online. When I visit the media page ...
0
votes
1
answer
187
views
How do I restore attachment from files in wp-upload
I used the wordpress import tool to import a file and downloaded the attachments included. After a successful importation, I discovered that my media library only contains 3 file. After hours of ...
1
vote
2
answers
1k
views
Wordpress can't get image url but both the attachment and the actual file are there
The following applies to all attchment images on my site:
There is a PNG image attachment, its ID is 519271.
wp_get_attachment_image(519271, 'thumbnail', false, array( 'id' => 'esjb-preview-image' )...
0
votes
0
answers
218
views
How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
I'm on a shared hosting plan. Getting this error log entry when the user tries to update any field on a Media Attachment.
[13-Oct-2022 20:10:05 UTC] PHP Fatal error: Maximum execution time of 60 ...