Appearance
Quick Start Guide
Get up and running with Virtual Files in just a few minutes! This guide will walk you through creating your first virtual file.
Step 1: Create Your First Virtual File
Navigate to Virtual Files
- Log in to your WordPress admin dashboard
- In the left menu, click Virtual Files
- Click Add New (or visit
wp-admin/edit.php?post_type=virtual_file)
Configure Your Virtual File
Basic Information
- Title: Enter a descriptive title (e.g., "Robots File")
- Filename: Enter the actual filename (e.g.,
robots.txt) - File Type: Select the appropriate extension from dropdown
File Content
- Content Editor: Add your file content
- Preview: See how your file will look when served
- Status: Set to "Active" to enable the file
Example: Creating robots.txt
text
User-agent: *
Allow: /
Disallow: /wp-admin/
Disallow: /wp-includes/
Sitemap: https://yourdomain.com/sitemap.xmlStep 2: Publish and Test
Publish Your File
- Click Publish in the right sidebar
- Confirm publication in the modal
- Your virtual file is now live!
Test Your Virtual File
Visit your new virtual file in the browser:
https://yourdomain.com/robots.txtYou should see the content you entered, served as a proper text file with correct headers.
Step 3: Create More Files
Example: JSON Configuration File
Create New File: Click Add New again
Set Details:
- Title: "API Configuration"
- Filename:
api-config.json - File Type: JSON
Add JSON Content:
json
{
"api_version": "1.0",
"site_name": "My WordPress Site",
"endpoints": {
"posts": "/api/posts.json",
"pages": "/api/pages.json",
"media": "/api/media.json"
},
"settings": {
"cache_timeout": 3600,
"enable_cors": true
}
}- Publish and test at
yourdomain.com/api-config.json
Example: Markdown Documentation
Create Documentation File:
- Title: "API Documentation"
- Filename:
api-docs.md - File Type: Markdown
Add Markdown Content:
markdown
# API Documentation
## Overview
This API provides access to site content in JSON format.
## Endpoints
### Posts
**URL**: `/api/posts.json`
**Method**: GET
**Returns**: Array of post objects
### Pages
**URL**: `/api/pages.json`
**Method**: GET
**Returns**: Array of page objects
## Usage Example
```javascript
fetch('/api/posts.json')
.then(response => response.json())
.then(posts => console.log(posts));License
© 2026 Your Website Name. All rights reserved.
## Step 4: Manage Your Files
### View All Virtual Files
1. Navigate to **Virtual Files** in admin
2. See all your virtual files in a table view
3. Each file shows:
- Filename and extension
- File size
- Last modified date
- Status (Active/Inactive)
### Edit Existing Files
1. Click on any file title in the list
2. Make changes to content or settings
3. Click **Update** to save changes
### Quick Actions
Hover over any file in the list to see:
- **Edit**: Modify file content
- **Quick Edit**: Change basic settings
- **Trash**: Delete the file
- **View**: Visit the file URL
## Step 5: Configure Settings
### Access Settings
1. Navigate to **Virtual Files → Settings**
2. Configure key options:
#### **Basic Settings**
- **Enable Virtual Files**: Keep this checked for functionality
- **Allowed Extensions**: Choose which file types to enable
#### **File Type Settings**
For each file type, you can:
- Enable/disable specific extensions
- Set default MIME types
- Configure access rules
### Pro Features (If Available)
- **Performance Caching**: Enable for faster file serving
- **Analytics**: Track file access and performance
- **Import/Export**: Backup and restore virtual files
## Common Use Cases
### **SEO Files**
```text
# robots.txt
User-agent: Googlebot
Allow: /
Crawl-delay: 1
User-agent: *
Disallow: /wp-admin/
Sitemap: https://yourdomain.com/sitemap.xmlAPI Endpoints
json
// posts.json
{
"status": "success",
"data": [
{
"id": 1,
"title": "Sample Post",
"url": "https://yourdomain.com/sample-post"
}
]
}Configuration Files
xml
<!-- web.config for IIS -->
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Virtual Files" stopProcessing="true">
<match url="^(robots\.txt|sitemap\.xml)$" />
<action type="Rewrite" url="index.php?virtual_file=1&file_id={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>Tips and Best Practices
File Naming
- Use descriptive, lowercase filenames
- Avoid special characters and spaces
- Use hyphens instead of underscores
- Keep filenames under 255 characters
Content Optimization
- Keep file sizes reasonable for performance
- Use appropriate MIME types
- Validate JSON/XML syntax
- Compress large text files when possible
Security Considerations
- Don't include sensitive information
- Validate user input in dynamic content
- Use HTTPS for sensitive endpoints
- Regularly review file access logs
Performance Tips
- Enable caching for frequently accessed files
- Use appropriate file formats
- Monitor file access patterns
- Consider CDN integration for high traffic
Next Steps
Now that you've created your first virtual files:
- Explore Features: Learn about advanced features
- Configure Settings: Fine-tune your plugin settings
- Learn File Types: Understand supported file types
- Enable Pro Features: Upgrade for advanced functionality
Need Help?
- Documentation: Browse our complete user guide
- Support: Visit our support forums
- FAQ: Check common questions
Congratulations! You've successfully created and deployed virtual files on your WordPress site. 🎉