WordPress:Answers-Configuration
These FAQs have been deprecated. You will find the new updated Frequently Asked Questions on the new pages for the WordPress:FAQ.
Formatting an Article's List of Categories
To configure the way a post's categories display, open the index.php file and find the text <?php the_category(. Immediately after that bracket, inside quote marks, is the text that goes between each of the categories if you apply multiple categories to a post.
WordPress doesn't add spaces to the separators, so if you want them, add them yourself. For example, if you want categories to be separated with commas, use <?php the_category(', ') rather than just <?php the_category(','). Similarly, if you want categories to be separated with bullets, you might use <?php the_category(' • ').
If Too Many Comments Go to Your Moderation Queue
If almost every comment anyone submits ends up in your moderation queue, there's probably a problem with your spam words list. Check the list under Options → Discussion carefully to ensure it doesn't have any items consisting of a single character, a blank line, or other whitespace. Sometimes blank lines can be introduced by spam plugins.
Stopping HTML in Comments
To prevent people from using HTML in comments, or to block particular HTML elements:
- In the folder wp-includes, find the file kses.php and open it.
- Find the text $allowedtags. It is followed by a list of the HTML elements allowed in comments.
- To prevent a partiular HTML element from being used, comment out the line for that element. To comment out a line, type // at the start of the line (some elements will probably be commented out already).
- If you never want any HTML in comments at all, you can delete the whole function -- from if (!CUSTOM_TAGS) to the next } -- but if you change your mind later, you'll need to get a new copy of kses.php.
Changing the Admin Name
To change the name of the WordPress admin account, log in to WordPress as admin, then choose Users. Under Your Profile you can enter your first name, last name, and nickname.
Finding the Absolute Path of a Page
To find the absolute path of a page, copy this text into a new text file:
<?php $p = getcwd(); echo $p; ?>
Save the file as path.php. Then open it in a Web browser (for example, http://www.example.com/images/path.php).
Files Affecting Weblog Display
These are the main files affecting the display of your site. They can be edited from the WordPress control panel under Presentation → Theme Editor.
- index.php
- In combination with other PHP files (see Template_Hierarchy), determines the overall HTML structure of each page.
- style.css
- Controls fonts, colors, margins, backgrounds, and so on.
- wp-comments.php
- Controls the layout of user-submitted comments and trackbacks, and the comments submission form.
- wp-comments-popup.php
- Only needed if you show comments in a popup window (this option is off by default).
Showing Comments in Popup Windows
To open a popup window when someone clicks a comments link:
In WordPress 1.2
Open index.php and find this line:
<?php //comments_popup_script(); // off by default ?>
Change it to:
<?php comments_popup_script(); // off by default ?>
In WordPress 1.5 Using the "Classic" Theme
Open header.php and find this line:
<?php //comments_popup_script(); // off by default ?>
Change it to:
<?php comments_popup_script(); // off by default ?>
In WordPress 1.5 Using the Default Theme
Open header.php and find this line:
<?php wp_get_archives('type=monthly&format=link'); ?>
Directly underneath it, add this line:
<?php comments_popup_script(); // off by default ?>
Hiding your Site
Whether you're testing a new version of WP, setting up a new blog or have some other reason to limit access, the following information may help you keep unwanted visitors out.
Blocking IP addresses using Apache
You can use the .htaccess file (which also contains your permalink code) to check for certain IP addresses and prevent them from viewing your site. This will only stop the IP address, not the person, so if they can switch to an IP address not in your blacklist, they will still be able to get to your site.
An .htaccess file can also be used to prevent people from "hot-linking" to your images (bandwidth theft), or to set up a password-protected site.
Basic Authentication
To block people from accessing your site unless they enter the correct password:
Using Apache
- .htaccess Definition
- Huge list of Apache .htaccess examples
- Tutorial on access control using .htpasswd
- Clockwatchers.com .htaccess And .htpasswd tools
= Using IIS
Deselect "Allow Anonymous Access" and select "Basic Authentication". You'll also need to have a username with a password.
- How To Configure IIS 5.0 Web Site Authentication
- How To Use NTFS Security to Protect a Web Page
- HOW TO: Configure Internet Information Services Web Authentication
Warning
With basic authentication, the password is encoded weakly (using base-64), and can be easily intercepted and decoded.
Search Engines: Spiders and Bots
Search engines will index your site and keep their own temporary copy of it for use in returning search results. If you do not want this to happen, use a file called robots.txt.
- Sample robots.txt optimized for SEO
- Creating the ultimate robots.txt
- SEO Optimized robots.txt and robots meta for WordPress
- Google information about robots.txt
Letting People Upload Images
To permit image uploads to your site:
- From the admin panel, go to Options → Miscellaneous.
- Select Allow File Uploads. For help finding the absolute path, see Absolute Path. For help changing permissions, see WordPress:Changing_File_Permissions.
- In the main menu, you should now see a new Upload item between Options and Log Out.