For directory (folder), only read
is not enough. You need to set execute
also. Because for directory, execute
means you can enter the directory.
Files need read
permission & directory needs read
& execute
permission.
So the directory permission should be: 0555
. However, image files inside that directory should be just read
, in numeric form: 0444
.
For example, in your case, /legacy-images/
directory will have 0555
permission & /legacy-images/image1.png
image file will have 0444
permission.
Shell Command
If you can access shell and know how to, you may use the following shell commands (replace <WP_DIRECTORY>
with appropriate WordPress installation directory):
cd <WP_DIRECTORY>
chmod 555 legacy-images/
cd legacy-images/
find ./ -type f -exec chmod 444 {} \;
Related Posts:
- How do I prevent a folder from reappearing in my home directory?
- What’s the best way to use the Featured Image for responsive web design?
- How do I hook into WordPress to save an uploaded photo as an alternate size to an existing photo?
- How to check if image is already stored in a site’s post database? (network)
- Adding a custom image upload size and making it selected by default?
- Hide custom image sizes from media library
- Namespacing WordPress project according to FIG standards
- Create Image Uploader for Widget
- Admin Media grid view images won’t load
- WordPress remove EXIF Data from specific Thumb
- How to resize image on client-side before upload?
- Adding Featured Image to Post programatically
- Does wordpress allow me to add a php file to the root directory to execute custom scripts?
- Get a Page’s attachments in Gallery order
- How to get custom image size for image uploaded in Customizer
- What’s the proper way to use wp_enqueue_script/style?
- wp-admin/index.php gives a “500 Internal Server Error [closed]
- Change the actual (or viewable) WordPress directory structure
- How to get media objects
- PHP code to call image Caption, Alternative Text, and Decription?
- Accessing site’s root from themes folder
- How do I let users upload files to a chosen location?
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- How to get specific image in media library with php
- hover image appears below placeholder instead of overlayed
- add_image_size for header_image
- Apache /Ubuntu server not running WordPress installation, outputting PHP code like HTML
- Add custom url to featured image
- Get image’s size name from it’s dimension
- Best practice for migration friendly images in posts/pages?
- How to Arrange PHP Files to Allow for Multiple Types of Pages?
- Correct folder permissions?
- PHP Warning: chmod(): Operation not permitted in class-wp-filesystem-direct.php on line 173
- Reprinting tags with all attributes
- Image rotation and editing stopped working in WordPress after upgrading Ubuntu from 16.04 to 18.04
- Unread Repeater field IMG alt not working
- subdirectory index.php is not working
- Upload multiple images to a Woocomerce product
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- Why my image upload button is not working in wordpress widget area?
- How to make own crop image function for WordPress plugin
- WordPress automatically adds links to uploaded images
- Call to undefined function mysql_connect() After upgrading PHP 7.1 to 7.3
- PHP in CSS file?
- Only show image from custom field when present
- Timthumb.php image gallery not working on Multisite WordPress
- Where are the src and srcset sizes coming from?
- HTML showing after PHP code in tag
- trying to get wp_get_attachment_url to output clickable link
- Change default gallery images – Currently they are displaying full size imagese
- Creating black and white copy of an image [closed]
- Shortcode function doesnt work without caption
- Get featured image with custom size outside WordPress
- Images Uploaded saving onto older/previous year folders
- Add valid XHTML closing img tags to WordPress galleries
- How to set a featured image (thumbnail) with PHP?
- Convert canvas to image and upload image to server
- Image rotation issue (horizontal picture uploading as vertical) — Exif issue?
- How to Make Thumbnail of Post Stay Animated
- Unexpected token ILLEGAL, even on clean install – jquery-issue?
- Convert all uploaded PNG files to PNG-8 format
- CSS images don’t show up with bloginfo
- Some problems in custom widget
- Displaying images outside the content
- Checking page before applying image restrictions while uploading
- Change extension to .jpg when webp is not supported
- Prepend to all image URLs with PHP, only for mobile devices
- Retrieve alt text by referencing the img src
- Show next image in array if page is revisited by same logged user
- Update Images after edit via php
- Configure WordPress to Use Responsive Image Rendering
- Replace background image with post thumbnail in shortcode
- How to get the url of the entry in which an image belongs
- New user – Create a folder
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- Get list of posts from attachment
- Get the image title and alt from custom query
- How to include different html tags in the header for different pages?
- How to always display full size image
- Resource 404 error on multisite subdirectory install
- Retrieving specific images from Media Library
- How do I routinely extract the thumbnail of the most recent post?
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Pass php to database in JQuery: With AJAX?
- magic-quotes – breaks admin totally
- Name Input from widget displays Sidebar name instead of saved data
- WP white screen of death after duping a site that works fine on same server
- Changing 2011 theme header image based on user dropdown
- images in wordpress themes
- How to use custom fields to replace top-level parent title with an image using wp_list_pages?
- Correct Syntax for uploading files to custom directory in WordPress
- How do I return an image from a script
- Display Post Titles on top of the_post_thumbnail()
- add if statement to the featured image
- How to automatically convert images to WebP on WordPress?
- WooCommerce: write featured image dimensions to custom fields in product’
- Generate and upload screenshot as featured image for user-submitted post
- How Create Automatically Image jpg.webp from image .jpg without delete or change original images upload
- Using Featured Image as Hero Background in Word Press
- How can add alt tag in following code. Image are showing dynamic in wordpress