How To Make WordPress Themes Writable?


Making WordPress themes writable is often necessary for allowing updates, modifications, or customizations directly from the WordPress dashboard. This typically involves setting the correct file permissions so that the web server can write to the theme files. Here’s a comprehensive guide to help you make your WordPress themes writable.

1. Understanding File Permissions

File permissions in a Unix-like operating system (such as Linux, which is commonly used for web servers) are expressed as a combination of read, write, and execute permissions. These permissions are assigned to three types of users:

  • Owner: The user who owns the file.
  • Group: Other users in the file’s group.
  • Others: All other users.

Permissions are typically represented by three-digit numbers. For example:

  • 755 means the owner has read, write, and execute permissions, while the group and others have read and execute permissions.
  • 644 means the owner has read and write permissions, while the group and others have read permissions.

Read: Tips To Master WordPress Website Management

2. Steps to Make WordPress Themes Writable

To change file permissions, you need to access your server. This can be done using:

  • FTP/SFTP: Using an FTP client like FileZilla.
  • SSH: Using a terminal or SSH client like PuTTY.
  • cPanel/File Manager: Provided by your web hosting control panel.

i) Locate Your Theme Directory: Your theme files are typically located in the wp-content/themes directory. Navigate to this directory using your preferred method (FTP, SSH, or File Manager).

ii) Change Permissions Using FTP/SFTP: Open your FTP client and connect to your server using your FTP credentials. Go to wp-content/themes.

  • Right-click on the theme folder you want to make writable.
  • Select “File Permissions” or “Permissions” (depending on your FTP client).
  • Set the numeric value to 755 for directories and 644 for files. If you need to make files writable (e.g., for editing PHP files), you can set them to 664.

iii) Change Permissions Using SSH: Open your terminal or SSH client and connect to your server using your SSH credentials. Run the following command to navigate to your theme directory:

cd /path-to-your-wordpress-installation/wp-content/themes

To set the correct permissions for directories, run:

find . -type d -exec chmod 755 {} \;

To set the correct permissions for files, run:

find . -type f -exec chmod 644 {} \;

If you need to make specific files writable, you can run:

chmod 664 your-theme-file.php

iv) Change Permissions Using cPanel/File Manager: Access your cPanel through your web hosting account. Go to File Manager. Navigate to public_html/wp-content/themes (or wherever your WordPress installation is located).

  • Select the theme folder you want to make writable.
  • Click on “Permissions” or “Change Permissions”.
  • Set the permissions to 755 for directories and 644 for files.

3. Important Considerations

Be cautious when setting permissions. Making files writable can pose a security risk if not managed properly. Always revert permissions to a more secure setting (like 644 for files) once you’ve made the necessary changes.

Sometimes permissions issues are related to ownership. Ensure that the web server user (e.g., www-data for Apache or nginx for Nginx) owns the WordPress files. You can change ownership using the chown command:

sudo chown -R www-data:www-data /path-to-your-wordpress-installation

To Sum Up

Making your WordPress themes writable involves changing file permissions to allow the web server to write to those files. This can be done using FTP, SSH, or your web hosting control panel’s File Manager. Always be mindful of security implications and revert permissions to a secure setting after making the necessary changes. By following these steps, you can ensure that your WordPress themes are writable and ready for updates and customizations.

Leave a Reply

Your email address will not be published. Required fields are marked *