You can do that programatically via wp_insert_attachment()
function.
Here is an example at WP Codex: http://codex.wordpress.org/Function_Reference/wp_insert_attachment
Related Posts:
- How do i upload an image and return the image id?
- Get images attached to a specific page
- Upload images to remote server
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- Using Images in WordPress – Best Practices
- Media Upload Folder – how to manage
- Get attachment ID of author_meta image – Attachment Metadata
- Alter media caption/description conflict in WordPress?
- Restrict the number of images to upload per post
- How to upload image without post ID using the new media uploader?
- Rename attachments during upload
- How to add a media with PHP
- What’s the best “insert all images” plugin?
- Different upload path per file type
- Is there a way to get attachment data?
- Rename media files generated during upload
- Link to full size image or attachment page in photo theme
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- media_sideload_image with rewritten urls?
- Change WordPress Media Manager
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- image in my post disappeared after I upload website to remote server
- Pull images from the gallery
- How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product
- WordPress automatically downscaled images larger that original
- Ho to add “Create Slider” option to default “Add Media” popup?
- Auto delete attachments that are older than x days
- Images uploaded to the media library has strange colors. However, in the edit screen the color is ok
- Change wp-content/uploads to uploads/%postname%/%image%
- Blank upload.php page
- Does wp_get_attachment_image_src also work with non-image files?
- Upload media only to DB
- WordPress Creates Unused (Unregistered) Image Sizes
- Is there a way in WordPress to convert images to WebP without a plugin?
- WordPress Attachments with old images
- Disable image rename on upload
- How can i identify media uploaded to my website that is not being used anywhere anymore?
- image URL changed in wordpress
- Attachments without images
- Serving Images from subdomain in wordpress
- User uploads image as “Featured Image” but WordPress resizes it?
- Profile image does not upload
- WordPress append -1 to the image name
- cant upload media/pictures to my wordpress site, cant upload anything to my database
- Upload error on localhost (at minimum, not yet tested online)
- unsharp thumbnails after uploading image
- Updated wordpress missing image upload area
- How to disable post-thumbnail from generation?
- Troubles with code for upload a image
- After I upload a file to library its name converted to dashes
- Missing Images in Uploads Directory (Server Only)
- Broken Media Library
- Upload unnattached image from frontend
- Media Library is not loading on grid view in admin panel
- Blurry Images WordPress 5.8.1
- How to get WordPress to resize images for srcset?
- Uploading media to wordpress API with C# HttpClient
- Each custom image size in custom upload directory?
- Adding a custom image upload size and making it selected by default?
- How do I detach images from posts?
- How to get all files inserted (but not attached) to a post
- Automatically wrap post image in div
- Open the attachment details modal
- Uploading images: ‘ø’ get replaced with ‘ø’
- SSL: How to make customizer images Protocol Relative in WordPress?
- Insert image in comment reply
- Can’t access ‘Store uploads in this folder’
- Thumbnails are bigger in size than the original image
- Faster way to put images into a blog post by using Add Media dialog
- Rotating image does not work for custom image sizes
- WordPress adds extra width to post images container boxes
- Alter the image, before save, of a particular image size
- Missing a temporary folder.error when image is uploaded in admin Set temporary Directory – WordPress 5.2.2
- WP fails to upload files to media library, /wp-admin/async-upload.php 403 forbidden
- Add a background image for Custom Post Type archives page
- Help to upload post attachments from Ajax
- Post and featured image have the same name, why is the attachment (image) is showing and not the post?
- How to get the Gallery form/section just like in Gutenberg block?
- How do you import images from a URL in your post?
- after migration, newly uploaded images won’t show up
- How to use getimagesize() of image upload?
- Alter the image used for a user who has not uploaded a custom image yet
- Allow users to upload multiple images to their profile
- Allow a specific user role I have created to only upload one image to his media library
- How to increase media image scale limit?
- Generate links on all images in posts – is there a hook?
- Get “Image CSS Class” value from the Advanced Options section
- Run command to optimize images after they get uploaded to WordPress
- Uploaded images not showing properly using wordpress
- Where to add my code to auto attach images to existing products
- Set WordPress to Create different images format later, not during upload
- The most of the images don’t appear, although URLs are correct
- WordPress Media URLs?
- attachment.php & flexslider—linking thumbnail to specific image
- page displaying media caption shortcodes
- Add two images with Sweet Testimonials
- Import existing image as a single post
- Stop Attachment image names from taking top level permalink
- How do I change a Themes Header Image?
- Media upload error