Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Puchar WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Przewodnik dla początkujących po strukturze plików i katalogów WordPressa

Uwaga redakcyjna: Otrzymujemy prowizję z linków partnerskich na WPBeginner. Prowizje nie mają wpływu na opinie i oceny naszych redaktorów. Dowiedz się więcej o Proces redakcyjny.

Chcesz poznać pliki i strukturę katalogów WordPressa?

Wszystkie rdzenne pliki WordPressa, motywy, wtyczki i pliki wgrywane przez użytkowników są przechowywane na twoim serwerze hostingowym.

W tym przewodniku dla początkujących wyjaśnimy strukturę plików i katalogów WordPressa.

WordPress file and directory structure explained for beginners

Dlaczego powinieneś poznać strukturę plików i katalogów WordPressa?

Większość użytkowników może uruchomić swoją witrynę internetową WordPress bez poznawania plików lub katalogów WordPress. Jednak zrozumienie, w jaki sposób WordPress przechowuje pliki i katalogi, może pomóc w samodzielnym rozwiązaniu wielu typowych problemów z WordPressem.

Ten przewodnik pomoże ci:

  • Dowiedz się, które pliki i katalogi WordPressa są plikami rdzeni.
  • Dowiedz się, w jaki sposób WordPress przechowuje twoje obrazki i przesłane multimedia.
  • Gdzie WordPress przechowuje twoje motywy i wtyczki.
  • Gdzie przechowywane są pliki konfiguracyjne w twojej instalacji WordPress.

Informacje te pomagają również dowiedzieć się, jak WordPress działa za kulisami i które pliki WordPress należy wykonać kopię zapasową.

Powiedziawszy to, przyjrzyjmy się strukturze plików i katalogów WordPress.

Dostęp do plików i katalogów WordPress

Twoje pliki i katalogi WordPress są przechowywane na serwerze WWW. Dostęp do tych plików można uzyskać za pomocą klienta FTP. Szczegółowe instrukcje znajdują się w naszym przewodniku na temat korzystania z FTP do przesyłania plików WordPress.

Łatwiejszą alternatywą dla FTP jest aplikacja File Manager, która jest wbudowana w większość paneli kontrolnych hostingu WordPress.

File manager app in hosting control panel

Po połączeniu się z twoją witryną WordPress za pomocą FTP lub Menedżera plików, zobaczysz strukturę plików i katalogów, która wygląda następująco:

WordPress files and folders

Wewnątrz katalogu głównego znajdują się pliki i foldery rdzeni WordPress. Są to pliki i katalogi, które uruchamiają twoją witrynę WordPress.

Poza plikami .htaccess i wp-config.php nie powinieneś edytować innych plików na własną rękę.

Oto lista rdzennych plików i katalogów WordPress, które można zobaczyć w katalogu głównym twojej witryny WordPress.

  • wp-admin [dir]
  • wp-content [dir]
  • wp-includes [dir]
  • index.php
  • license.txt
  • readme.html
  • wp-activate.php
  • wp-blog-header.php
  • wp-comments-post.php
  • wp-config-sample.php
  • wp-cron.php
  • wp-links-opml.php
  • wp-load.php
  • wp-login.php
  • wp-mail.php
  • wp-settings.php
  • wp-signup.php
  • wp-trackback.php
  • xmlrpc.php

Na powyższej liście brakuje plików .htaccess i wp-config.php. Dzieje się tak, ponieważ te dwa pliki są tworzone po instalacji WordPressa.

Pliki konfiguracyjne WordPress

Twój katalog główny WordPress zawiera specjalne pliki konfiguracyjne. Pliki te zawierają importowane ustawienia specyficzne dla twojej witryny WordPress.

WordPress configuration files
  • .htaccess – plik konfiguracyjny serwera, WordPress używa go do zarządzania bezpośrednimi odnośnikami i przekierowaniami.
  • wp-config.php – Ten plik mówi WordPressowi, jak połączyć się z twoją bazą danych. Ustawia również niektóre globalne ustawienia dla twojej witryny WordPress.
  • index.php – Plik indeksu zasadniczo wczytuje i inicjalizuje wszystkie pliki WordPressa, gdy użytkownik żąda twojej strony.

Czasami może być konieczna edycja pliku wp-config.php lub .htaccess. Zachowaj szczególną ostrożność podczas edycji tych dwóch plików. Drobny błąd może sprawić, że twoja witryna będzie niedostępna. Podczas edycji tych dwóch plików zawsze twórz kopie zapasowe na twoim komputerze przed wprowadzeniem jakichkolwiek zmian.

Jeśli nie widzisz pliku .htaccess w twoim katalogu głównym, zapoznaj się z naszym przewodnikiem na temat tego, dlaczego nie możesz znaleźć pliku .htaccess w katalogu głównym WordPress.

W zależności od tego, jak skonfigurowana jest twoja witryna WordPress, możesz mieć lub nie mieć następujących plików w katalogu głównym.

  • robots.txt – zawiera instrukcje dla robotów indeksujących wyszukiwarek.
  • Favicon.ico – plik favicon jest czasami generowany przez hosty WordPress.

Wewnątrz katalogu wp-content

WordPress przechowuje wszystkie przesłane pliki, wtyczki i motywy w katalogu wp-content.

WordPress content folder

Ogólnie przyjmuje się, że można edytować pliki i katalogi wewnątrz katalogu wp-content. Nie jest to jednak do końca prawdą.

Zajrzyjmy do katalogu wp-content, aby zrozumieć, jak on działa i co można w nim zrobić.

Inside wp-content folder

Treść katalogu wp-content może się różnić w zależności od witryny WordPress. Jednak wszystkie witryny WordPress zazwyczaj je posiadają:

  • [dir] motywy
  • [dir] wtyczki
  • [dir] uploads
  • index.php

WordPress przechowuje twoje pliki motywów w katalogu /wp-content/themes/. Możesz edytować plik motywu, ale generalnie nie jest to zalecane. Jak tylko zaktualizujesz swój motyw do nowszej wersji, twoje zmiany zostaną nadpisane podczas aktualizacji.

Dlatego też zaleca się utworzenie motywu potomnego w celu dostosowania motywu WordPress.

Wszystkie wtyczki WordPress, które pobierasz i instalujesz na swojej witrynie, są przechowywane w katalogu /wp-content/plugins/. Nie powinieneś bezpośrednio edytować plików wtyczek, chyba że napisałeś wtyczkę WordPress specyficzną dla twojej witryny na własny użytek.

W wielu poradnikach WordPress można znaleźć fragmenty kodu, które można dodać do twojej witryny WordPress. Możesz dodać własny kod do swojej witryny WordPress, dodając go do pliku functions.php motywu potomnego lub tworząc wtyczkę specyficzną dla witryny.

Jednak najłatwiejszym i najbezpieczniejszym sposobem dodania własnego kodu jest użycie wtyczki fragmentów kodu, takiej jak WPCode. Aby uzyskać instrukcje krok po kroku, zobacz ten przewodnik, jak łatwo dodać własny kod w WordPress.

WordPress przechowuje wszystkie twoje obrazki i media w katalogu /wp-content/uploads/. Domyślnie przesłane pliki są zorganizowane w katalogach /rok/miesiąc/ . Za każdym razem, gdy tworzysz kopię zapasową WordPressa, powinieneś dołączyć katalog uploads.

Możesz pobrać świeże kopie rdzenia WordPressa, twojego motywu i zainstalowanych wtyczek z ich źródeł. Jeśli jednak utracisz twój katalog uploads, bardzo trudno będzie go przywrócić bez kopii zapasowej.

Niektóre inne domyślne katalogi mogą być widoczne w twoim katalogu wp-content.

Wiele wtyczek WordPress może również tworzyć własne katalogi wewnątrz twojego katalogu wp-content do przechowywania plików.

Niektóre wtyczki WordPress mogą tworzyć katalogi wewnątrz katalogu /wp-content/uploads/ w celu zapisywania plików przesłanych przez użytkowników. Na przykład, ta witryna internetowa demo ma katalogi utworzone przez wtyczki Smash Balloon, WooCommerce, SeedProd i WPForms.

Plugins may create their own folders inside uploads directory

Niektóre z tych katalogów mogą zawierać ważne pliki. Dlatego na wszelki wypadek zalecamy tworzenie kopii zapasowych wszystkich takich katalogów.

Inne katalogi mogą zawierać pliki, które można bezpiecznie usunąć. Na przykład twoje wtyczki buforujące, takie jak WPRocket, mogą tworzyć katalogi do zapisywania danych podręcznych.

Mamy nadzieję, że ten artykuł pomógł ci zrozumieć strukturę plików i katalogów WordPress. Możesz również zapoznać się z naszym przewodnikiem dla początkujących na temat zarządzania bazą danych WordPress za pomocą phpMyAdmin oraz naszym poradnikiem na temat tworzenia własnego motywu WordPress bez znajomości kodowania.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Ujawnienie: Nasze treści są wspierane przez czytelników. Oznacza to, że jeśli klikniesz na niektóre z naszych linków, możemy otrzymać prowizję. Zobacz jak WPBeginner jest finansowany, dlaczego to ma znaczenie i jak możesz nas wspierać. Oto nasz proces redakcyjny.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Najlepszy zestaw narzędzi WordPress

Uzyskaj BEZPŁATNY dostęp do naszego zestawu narzędzi - zbiór produktów i zasobów związanych z WordPressem, które każdy profesjonalista powinien mieć!

Reader Interactions

57 komentarzyZostaw odpowiedź

  1. Syed Balkhi says

    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!

  2. Moinuddin Waheed says

    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.

    • WPBeginner Support says

      It is almost the same, a multisite install would have folders for each of the subsites.

      Administrator

  3. Fawwad says

    Thanks for sharing this information. This will help a lot during troubleshooting and website backup n restore.

  4. Amit Maheshwari says

    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?

  5. Kosovi says

    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.

  6. Bruno rasmussen says

    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

  7. J.Hameed says

    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 says

      The closest to what it sounds like you’re wanting is under wp-content>Uploads

      Administrator

  8. John says

    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

  9. Karen says

    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 says

      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.

      Administrator

  10. Mary Emerson says

    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!

  11. Lalit Kumar Yadav says

    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.

  12. Ajju says

    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

  13. JohnLeyo says

    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?

  14. Ben says

    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.

  15. Hany Danial says

    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

  16. Amit says

    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

  17. tushar says

    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

  18. john says

    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

      • john says

        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

  19. Ezeudo Emmanuel says

    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

  20. KAIZER MD AMIN says

    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.

  21. fassaha says

    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 says

      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? :)

  22. ademola says

    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.

  23. mimo says

    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…

      • Buck Riley says

        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 says

          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 says

          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 says

          „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 says

          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.

  24. Hemang Rindani says

    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.

  25. Rafique says

    Thank You so much. It was Really Helpful for me. I work in my University Webteam and have made a website for them :)

Zostaw odpowiedź

Dziękujemy za pozostawienie komentarza. Pamiętaj, że wszystkie komentarze są moderowane zgodnie z naszymi polityka komentarzy, a Twój adres e-mail NIE zostanie opublikowany. NIE używaj słów kluczowych w polu nazwy. Przeprowadźmy osobistą i konstruktywną rozmowę.