Volete imparare a conoscere i file e la struttura delle directory di WordPress?
Tutti i file principali di WordPress, i temi, i plugin e i caricamenti degli utenti sono memorizzati sul server di hosting del sito web.
In questa guida per principianti, spiegheremo la struttura dei file e delle directory di WordPress.
Perché dovreste imparare la struttura dei file e delle directory di WordPress?
La maggior parte degli utenti può gestire il proprio sito web WordPress senza conoscere i file o le directory di WordPress. Tuttavia, capire come WordPress memorizza i file e le directory può aiutarvi a risolvere da soli molti problemi comuni di WordPress.
Questa guida vi aiuterà:
- Imparare quali file e cartelle di WordPress sono file fondamentali.
- Capire come WordPress memorizza le immagini e i caricamenti multimediali.
- Dove WordPress memorizza i temi e i plugin.
- Dove sono archiviati i file di configurazione dell’installazione di WordPress.
Queste informazioni aiutano anche a capire come funziona WordPress dietro le quinte e quali sono i file di WordPress di cui è necessario fare il backup.
Detto questo, diamo un’occhiata alla struttura dei file e delle directory di WordPress.
Accesso ai file e alle directory di WordPress
I file e le directory di WordPress sono memorizzati sul vostro server di web hosting. Potete accedere a questi file utilizzando un client FTP. Per istruzioni dettagliate, consultate la nostra guida su come utilizzare FTP per caricare i file di WordPress.
Un’alternativa più semplice all’FTP è l’applicazione File Manager integrata nella maggior parte dei pannelli di controllo degli hosting WordPress.
Una volta che vi siete collegati al vostro sito WordPress tramite FTP o File Manager, vedrete una struttura di file e directory che assomiglia a questa:
All’interno della cartella principale sono presenti i file e le cartelle principali di WordPress. Si tratta dei file e delle cartelle che gestiscono il vostro sito WordPress.
Oltre ai file .htaccess e wp-config.php, non è consentito modificare altri file per conto proprio.
Ecco un elenco dei file e delle cartelle principali di WordPress che si trovano nella directory principale del sito WordPress.
- wp-admin [dir]
- wp-content [dir]
- wp-includes [dir]
- index.php
- licenza.txt
- readme.html
- wp-activate.php
- wp-blog-header.php
- wp-commenti-post.php
- wp-config-sample.php
- wp-cron.php
- wp-link-opml.php
- wp-caricamento.php
- wp-login.php
- wp-mail.php
- wp-impostazioni.php
- wp-signup.php
- wp-trackback.php
- xmlrpc.php
Nell’elenco precedente mancano i file .htaccess e wp-config.php. Questo perché questi due file vengono creati dopo l’installazione di WordPress.
File di configurazione di WordPress
La directory principale di WordPress contiene alcuni file di configurazione speciali. Questi file contengono importanti impostazioni specifiche per il vostro sito WordPress.
- .htaccess – Un file di configurazione del server, che WordPress utilizza per gestire i permalink e i reindirizzamenti.
- wp-config.php – Questo file indica a WordPress come connettersi al database. Imposta anche alcune impostazioni globali per il vostro sito WordPress.
- index.php – Il file index carica e inizializza tutti i file di WordPress quando una pagina viene richiesta da un utente.
A volte potrebbe essere necessario modificare il file wp-config.php o .htaccess. Fate molta attenzione quando modificate questi due file. Un piccolo errore può rendere il vostro sito inaccessibile. Quando modificate questi due file, create sempre delle copie di backup sul vostro computer prima di apportare qualsiasi modifica.
Se non vedete il file .htaccess nella directory principale, consultate la nostra guida sul perché non si trova il file .htaccess nella directory principale di WordPress.
A seconda di come è impostato il vostro sito WordPress, potreste avere o meno i seguenti file nella vostra directory principale.
- robots.txt – contiene istruzioni per i crawler dei motori di ricerca
- Favicon.ico – Un file favicon viene talvolta generato dagli host di WordPress.
All’interno della cartella wp-content
WordPress memorizza tutti i caricamenti, i plugin e i temi nella cartella wp-content.
Generalmente si pensa che sia possibile modificare i file e le cartelle all’interno della cartella wp-content. Tuttavia, questo non è del tutto vero.
Diamo uno sguardo all’interno della cartella wp-content per capire come funziona e cosa si può fare qui.
Il contenuto della cartella wp-content può variare da un sito WordPress all’altro. Ma tutti i siti WordPress di solito hanno questi contenuti:
- [dir] temi
- [dir] plugin
- [dir] uploads
- index.php
WordPress memorizza i file dei temi nella cartella /wp-content/themes/
. È possibile modificare un file di tema, ma in genere non è consigliabile. Non appena si aggiorna il tema a una versione più recente, le modifiche apportate verranno sovrascritte durante l’aggiornamento.
Per questo motivo si consiglia di creare un tema figlio per la personalizzazione del tema di WordPress.
Tutti i plugin di WordPress che scaricate e installate sul vostro sito sono memorizzati nella cartella /wp-content/plugins/. Non è consentito modificare direttamente i file dei plugin, a meno che non abbiate scritto un plugin di WordPress specifico per il vostro sito.
In molti tutorial di WordPress, vedrete degli snippet di codice che potrete aggiungere al vostro sito WordPress. Potete aggiungere codice personalizzato al vostro sito WordPress aggiungendolo al file functions.php del vostro tema figlio o creando un plugin specifico per il sito.
Tuttavia, il modo più semplice e sicuro per aggiungere codice personalizzato è utilizzare un plugin di snippets di codice come WPCode. Per istruzioni passo passo, consultate questa guida su come aggiungere facilmente codice personalizzato in WordPress.
WordPress memorizza tutti i caricamenti di immagini e media nella cartella /wp-content/uploads/
. Per impostazione predefinita, i caricamenti sono organizzati nelle cartelle /anno/mese/
. Ogni volta che si crea un backup di WordPress, è necessario includere la cartella uploads.
È possibile scaricare copie fresche del nucleo di WordPress, del tema e dei plugin installati dalle loro fonti. Ma se perdete la cartella uploads, sarà molto difficile ripristinarla senza un backup.
Alcune altre cartelle predefinite che si possono vedere nella cartella wp-content.
- languages – WordPress memorizza i file delle lingue per i siti WordPress non inglesi in questa cartella.
- upgrade – È una cartella temporanea creata da WordPress durante l’aggiornamento a una versione più recente.
Molti plugin di WordPress possono anche creare le proprie cartelle all’interno della cartella wp-content per archiviare i file.
Alcuni plugin di WordPress possono creare cartelle all’interno della cartella /wp-content/uploads/
per salvare i caricamenti degli utenti. Ad esempio, in questo sito web demo sono presenti cartelle create dai plugin Smash Balloon, WooCommerce, SeedProd e WPForms.
Alcune di queste cartelle possono contenere file importanti. Per questo motivo si consiglia di eseguire il backup di tutte queste cartelle per precauzione.
Altre cartelle possono contenere file che si possono tranquillamente eliminare. Ad esempio, i plugin di caching come WPRocket possono creare cartelle per salvare i dati di caching.
Questo è tutto, speriamo che questo articolo vi abbia aiutato a capire la struttura dei file e delle directory di WordPress. Potreste anche consultare la nostra guida per principianti alla gestione del database di WordPress con phpMyAdmin e il nostro tutorial su come creare un tema WordPress personalizzato senza alcuna conoscenza di codifica.
Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.
Syed Balkhi
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Moinuddin Waheed
I have always fantasized about what goes behind the scene to run such a good wordpres front end and backend interface.
This guide has cleared all those behind the scene aspect of wordpress working.
Having a knowledge of these files and directories structure gives us command over tweaks that we can make.
Thanks wpbeginner for this guide on wordpress file structure.
JIU-RAN CHEN
This folder layout is same as a multsite set up?
Thank you.
WPBeginner Support
It is almost the same, a multisite install would have folders for each of the subsites.
Admin
diaojiulishifei
Hi there, just curious. Is this post still relevant today?
WPBeginner Support
Yes, you can still use the information in this guide.
Admin
Fawwad
Thanks for sharing this information. This will help a lot during troubleshooting and website backup n restore.
WPBeginner Support
You’re welcome, glad you found our guide helpful
Admin
Amit Maheshwari
Please help me on how can I create a folder inside my blog hoste on wordpress on my site. I want to create more subfolder under that like news, life etc to make sure my users get the content more organized?
WPBeginner Support
It sounds like you want to create categories, you would want to take a look at our explanation on them below:
https://www.wpbeginner.com/glossary/category/
Admin
Ron
Great article. Where do the actual blog and posts end up?
WPBeginner Support
Those would be stored in your database and not as a WordPress file
Admin
Kosovi
Getting this error: Fatal error: Call to undefined function wp() in XXXX\html\wp-blog-header.php on line 12. Tried several troubleshooting, but wont solve the issue. Stoped Theme, and pluggins.
WPBeginner Support
You may want to try updating your files using method 2 from our article here: https://www.wpbeginner.com/beginners-guide/ultimate-guide-to-upgrade-wordpress-for-beginners-infograph/
Admin
Bruno rasmussen
Hi
Im getting the error message about a missing ads.txt file, i know where to find it, but im not sure where i have to insert it.
Best regards
Bruno
Denmark
WPBeginner Support
You would insert it where your WordPress files are located, where you can see the wp-admin and wp-content folders or you could take a look at our guide here: https://www.wpbeginner.com/plugins/how-to-create-and-manage-ads-txt-files-in-wordpress/
Admin
J.Hameed
Am trying to upload an unzipped file to this location:
wp-content/uploads/GeoLite2-Country.mmdb
Question : How do I find the location and how do i upload the unzipped file to this location.
WPBeginner Support
You would use an FTP or a file manager if your hosting provider offers one and go into the folders wp-content then your uploads folder:
https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
Admin
Atalia
Hi
Is there a “download” folder in wordpress and where is it located?
WPBeginner Support
The closest to what it sounds like you’re wanting is under wp-content>Uploads
Admin
John
Hi
My website was hacked. it keeps redirecting me to a spammy site. I can’t log in via the backend (cos it keeps redirecting me to a spammy site) and I don’t have a backup of the site but I can still access my Cpanel but dont know what to do there, please any help will be appreciated.
hemjaypost.com is the site
WPBeginner Support
You would want to go through the steps in our article: https://www.wpbeginner.com/beginners-guide/beginners-step-step-guide-fixing-hacked-wordpress-site/
Admin
Karen
Crazy question.
After importing demo site content on an Avada themed site – there are so many pages I have NO IDEA how to get back to identify and edit my home page in the PAGES link? I now have 8 pages of “pages”. How can I find my Home page? BTW – In READINGS > SETTINGS – I’ve checked blog assigned to home page NOT to a STATIC Page. Many thanks!
I have googled several ways – but can’t figure out this thing!
WPBeginner Support
Hi Karen,
When you go to Pages » All Pages you should be able to see — Homepage label next to the page used as your homepage. You can also try reaching out to the theme developer for support.
Admin
Mary Emerson
I, too, want to find where my old .htm files that are now encased in WordPress with different urls! I need to delete a bad xml file and I have to idea how to go to server and remove. I removed it permanently inside the page list, but I am afraid Bing is still thinking that is what I want submitted. It keeps saying it is not valid and I want to clear it out!
Thank you!
Lalit Kumar Yadav
hi
i developed an custom post in woocommerce website. But after that i want to use an dynamic photo slider in this custom post, i tried a lot but failed to make it dynamic.please guide me about the use of page template and how to make slider dynamic.
Monika Bhasin
Thanks for that article
Archie
I just started learning PHP and WordPress. This information is very helpful.
Ajju
Helpfull but i want edit a page outside without WordPress , by another html editer ,becouse i try to remove theme on some specific pages ,but not entier website
JohnLeyo
thank you, that was very helpful… but i want to know if it is safe to replace all the wordpress core files by a new files?
Ben
Hi there, I recently downloaded my old WordPress site onto my computer, and installed a new site on my domain. I am now trying to dig around and find all my blog posts from the old site so I can add them to the new site, any idea if thats possible and where I would find those? Thanks so much for your help.
Windigo
Your posts are stored in the database, you won’t find them in your wordpress folders.
Hany Danial
what is the file name for the users in the wordpress? I have a complete backup for my site, moved it to another server, the number of the users were about 24K but now I found only 9K and I would like to restore the old one. Thanks in advance for your reply. Hany Danial
Amit
Hi,
Suppose if I want to change the look of the WordPress theme then which files are important or in which file do I need to change the code?
Since last 2 years I am thinking to change the some little look of my theme but because of not fully understanding I couldn’t do it.
Thanks,
Amit
WPBeginner Support
Hey Amit,
Check out our guide on how to find which files to edit in WordPress theme.
Admin
tushar
Hi, thank you for this post I agree with you that An easier alternative to FTP is File Manager. It is a web-based application that comes built into cPanel dashboard of your WordPress hosting account. very useful information
john
how to i change upload the pictures for the web site or upload the new coupon for the website that use WordPress or edit the content of the website?
when I login to the FTP site, i see these 3 folders
wp-admin
wp-content
wp-includes
thanks
john
WPBeginner Support
Hi John,
You do not need to use FTP to make changes to your WordPress site. You can login to the admin area of your WordPress site and then go to Media to edit or upload images.
Admin
john
thanks. the company who wrote the website did not transition to me. How do I request to reset the password to login to the admin page?
also, i need to update just the coupons by update the new images of the coupons.
also, how to i transfer the page_id=369 to the coupons page
thanks again,
John
WPBeginner Support
Hey John,
You can ask your WordPress hosting company to reset password for you. You can also try our guide on how to add an admin WordPress user using FTP. However, please note that this is an advanced tutorial and if something goes wrong your entire website could become inaccessible.
Ezeudo Emmanuel
great article. But I have a question though. I am a beginner and trying to design a website via wordpress. i have finished the design to an extent. but my problem is that when i try to upload my wordpress file via ftp (file zilla), i cant seem to find the file on my C:/. how to i locate my wordpress file? thank you as i await your response
KAIZER MD AMIN
It is really helpful for me as I am just starting out with my blog and I have very little knowledge about these technical issues. Great content, thanks.
WPBeginner Support
Hi Kaizer,
We are glad you found it helpful. Don’t forget to join us on Twitter for more WordPress tips and tutorials.
Admin
fassaha
Great article! I do have a question though: Where do we actually find the articles that we wrote on the site? Let say I write an article on my site. This article is normally stored in wordpress files. where can I find it?
Thanks
Henric Åkesson
Your article itself will not be stored in files, it will be stored in the database. Only your files will be stored inside the wp-content/uploads.
Ok?
ademola
please i need your help urgently, i want to restart my afresh. But i just need my articles and its images. i do not need anything else.The reason for this is that my hosting is saying someone is using my site to spam people using a business address i did not even add to my webmail. if i delete it they create another one. but now another issue is thta malware are been detected on the site. but i am using the newspaper theme so i do not know why all this issues. I can do all the installing of new wordpress and every other thing but i need to just put the contents i have on the new site i am going to create. i still have my old site on now and i have the backup in my file manager home directory.
mimo
Thanks for the article….what about finding “pages” on the directory? i cant seem to find them…will they be accessible via cpanel or just in the wp interface? i see all the image files i uploaded on the [dir]uploads page, organized by month/year as you mentioned on the cpanel directory, but was wondering where i can find the actual Pages file/word content pages? thank you…
WPBeginner Support
WordPress generates your posts and pages on the fly from your database.
Admin
Buck Riley
So, there’s no way to get the contents of the page themselves through the FTP? Like, if I wanted to pull my about page from the FTP, I wouldn’t be able to do that?
Buck Riley
Or… is this databased stored elsewhere on the site outside of the wordpress folder, and having only backed up the wordpress folder when my site was deleted, I’ve lost all of my content?
WPBeginner Support
No, you will not be able to do that.
WordPress does not create and store static pages. Instead, it stores your content in a database and then generates HTML pages on the fly.
Robert
“No, you will not be able to do that.
WordPress does not create and store static pages. Instead,
it stores your content in a database and then generates
HTML pages on the fly.”
After a WSOD and several hours of trying to get back to the dashboard, I deleted all WP files from my file mgr. Before I did that I backed up and stored all of those files in a temp file in file manager.
Is there a way I can get my input (static pages) generated in html, so I may copy them?
I am about ready to install another WP theme, but before I do so I hold a slim hope that these pages are still stored somewhere, like in an etheral world of some database.
Josh
Robert, I second your motion. The answer has been rather expertly skirted around here. Is there some kind of membership fee we need to pay for these kind of seemingly simple answers? All I can find is the import/export tool for the pages, then edit the CSS or delete the unnecessary pages as desired.
Hemang Rindani
Nice article. For development team working with enterprise content management services like WordPress (or in that matter any other CMS like Sitefinity, Drupal, etc.) must understand the basic file structure. This will not only help them find the files but with this they will also be able to organize the files in proper way.
Using a nested approach to save your content and system files is a the best way to design a file structure.
Rafique
Thank You so much. It was Really Helpful for me. I work in my University Webteam and have made a website for them
Kang Irul
How to change wp-content directory??
tarif
Great job, sir, God bless you