Change upload directory in WordPress - wordpress

Can anyone tell me about how to change upload directory without touching wp-config.php in WordPress?

You need to go in wp-config.php and and set upload path:
define( 'UPLOADS', 'wp-content/'.'files' );
If you want the upload directory outside of wp-content you need to set upload path in wp-config.php like this:
define( 'UPLOADS', ''.'files' );

For same issue i used this manual link
Hope it will be helpful for you

let's say you upload a picture. After you upload it, you can view the file at something like:
example.org/wp-content/uploads/2014/12/picture.png
And let's say you now change the uploads folder location via:
Now you need to change in wp-config.php
define('UPLOADS', 'wp-content/media');
This will give you a URL like this:
example.org/wp-content/media/2014/12/picture.png
Hope this will help!

Related

Unable to create directory while adding pictures

I have the following issue in WordPress whenever I upload pictures. I have already added the following
code to wp-config.php
define( 'UPLOADS', 'wp-content/uploads' );
but still, I get this issue
"Unable to create directory wp-content/uploads/2021/03. Is its parent directory writable by the server?"

Wordpress Default Directory Change

I am trying to change the default path of the WP default directories such as wp-content, wp-include etc to avoid wpscan.
I have tried using plugin would it possible to perform the same using manual techniques. I am using apache as a web server.
An example, I have tried:
RewriteRule ^cms_plugins/(.+) /wordpress/wp-content/plugins/$1 [L,QSA]
Thanks
Try the following steps to rename WP-Content Folder
Download the WP-Config.php file
Open and Edit the Wp-Config.php file to add the below line
define( 'WP_CONTENT_FOLDERNAME', ‘new_directry_name’ );
Change 'new_directory_name' to the name you want for your content folder.
Upload WP-Config.php file back to your server
Follow these steps to replace the WP_Content folder
Download WP-Config.php file
Open and add the below lines
define( 'WP_CONTENT_DIR', ‘new_directry_local_path’ );
define( 'WP_CONTENT_URL', 'http://new_directry_url' );
Change new_directory_local_path and http://new_directory_url to your local path and URL.
Upload back to your server

Upload an image in wordpress on a local server

I am making my first steps coding and I have wordpress installed on my computer on a local XAMPP server. I try to add an image directly in a page from the wp admin but it's not possible and it shows me this error :
Unable to create directory wp-content/uploads/2016/03. Is its parent directory writable by the server?
Do you know why it happens? I create manually the directory wp-content/uploads/2016/03 and its still happening.
Create folder with name "uploads" in wp-content folder and set this folder permission 777
Hope it will work
Thanks
Try to manually update/change the uploads directory instead of defaults:
Log into your WordPress admin dashboard.
Go to Media Settings menu (Settings -> Media).
Enter wp-content/uploads in the “Store uploads in this folder” text
box.
Save the changes by hitting the “Save Changes” button and you are
done.
Note: if you don't have this option in your wordpress version, you need to edit the wp-config.php file located in the root directory of your WordPress installation.
define( 'UPLOADS', 'wp-content/'.'uploads' );
also you can change the name of uploads folder as you want.
UPDATE 1:
Try adding the following to the top of your .htaccess file (before # BEGIN WordPress line):
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

Moving wp-content folder to Amazon S3/CloudFront?

I would like to move my wp-content folder to Amazon S3/CloudFront.
I copied the folder to an S3 bucket.
I am in the process of editing the wp-config.php file in order to tell it where to find the moved wp-content folder.
But I am unable to find out which URL to link to?
Do I link to S3 or to CloudFront?
And where do I find the link that I need to enter into wp-config.php?
In order to store the files on S3, you will need to change both the directory location and the URL WordPress renders.
You will need a tool that can map S3 as a local mapped network drive. Check out FUSE or TNT Drive. Create a new network drive mapped to S3 using one of these tools.
Include these lines anywhere above the line where WordPress includes the wp-settings.php. Inside your wp-config.php file:
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/Mapped/S3Folder/ToBucket/wp-content' );
define( 'WP_CONTENT_URL', 'http://www.domain.com/blog/path/to/wp-content' );

Images are not displayed in wordpress media Library

Actually I am facing an error while uploading the images and insert it into post in wordpress.
Here I am Unable to view the uploaded images in the Media Library
Try to check permission of that "upload" folder, give 777 or remove read only from whole subfolders of "upload" folder.
give 777 to "upload"
Thanks
Even after changing the permission to 777 i couldn't get it working in my latest wordpress 3.9.1 fresh install. Then i found out that my custom theme was out dated and i had to add the below line in functions.php file inside my custom theme folder
wp_enqueue_script( 'jquery-ui-dialog', false, array('jquery'), false, true );
I found that from this link --> http://wordpress.org/support/topic/add-media-functionality-on-391-not-workingg
Hope that helps.

Resources