This guide will walk you through implementing IPTC Publisher Info on your website. The process involves creating an HTML file that embeds JSON-LD metadata in the standard schema.org format and making it accessible at a specific URL.
Before creating your file, gather the following information:
publisher-info.html fileexamples/publisher-info.html as a templateYour file must be accessible at:
https://yourdomain.com/.well-known/publisher-info.html
Alternatively, you can embed the JSON-LD directly in your main website pages (such as your homepage or about page) using a <script type="application/ld+json"> tag in the <head> section.
.well-known folder if it doesn't existpublisher-info.html to the .well-known folder.well-known directorypublisher-info.html file# Connect to your server
ssh username@yourdomain.com
# Navigate to website root
cd /var/www/html
# Create .well-known directory
mkdir -p .well-known
# Upload your file (if you have it locally)
scp publisher-info.html username@yourdomain.com:/var/www/html/.well-known/
If you prefer to embed the JSON-LD in your existing website pages:
1. Copy the JSON-LD content from your generated file
2. Add it to your website's HTML <head> section using:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "NewsMediaOrganization",
// ... your publisher info data
}
</script>
Ensure your server serves the HTML file with the correct MIME type:
Apache (.htaccess)
<Files "publisher-info.html">
Header set Content-Type "text/html; charset=utf-8"
</Files>
Nginx
location ~* \.html$ {
add_header Content-Type "text/html; charset=utf-8";
}
cPanel/Shared Hosting - Most shared hosting providers automatically set the correct MIME type for HTML files - If not, contact your hosting provider
Add CORS headers to allow cross-origin access:
Apache (.htaccess)
<Files "publisher-info.html">
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET"
Header set Access-Control-Allow-Headers "Content-Type"
</Files>
Nginx
location ~* \.html$ {
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET";
add_header Access-Control-Allow-Headers "Content-Type";
}
https://yourdomain.com/.well-known/publisher-info.html<script type="application/ld+json"> tagCause: File not uploaded to correct location or server not configured
Solution:
- Verify file is in /.well-known/publisher-info.html
- Check file permissions (should be readable by web server)
- Ensure .well-known directory is accessible
- If using embedded approach, verify the JSON-LD is in the page source
Cause: Server serving file with incorrect MIME type
Solution: Configure server to serve .html files as text/html; charset=utf-8
Cause: Server not properly configured for HTTPS
Solution:
- Ensure SSL certificate is valid
- Configure HTTPS redirects properly
- Test with https://yourdomain.com/.well-known/publisher-info.html
Cause: Missing CORS headers Solution: Add CORS headers to your server configuration (see Step 4)
Cause: Syntax errors in your JSON-LD within the HTML file
Solution:
- Use a JSON validator to check syntax
- Ensure all quotes and brackets are properly closed
- Verify the JSON-LD is properly wrapped in <script type="application/ld+json"> tags
- Test with the IPTC Publisher Info validator tool
.htaccess files for configurationmod_headers module is enabledapache2ctl -tnginx -s reloadnginx -t/wp-content/uploads/.well-known/ or root directory.htaccess for custom headersstatic or public directory.well-known folder is included in buildIf using a custom domain, ensure the file is accessible at:
https://customdomain.com/.well-known/publisher-info.html
For subdomains, create separate files:
https://news.yourdomain.com/.well-known/publisher-info.html
https://blog.yourdomain.com/.well-known/publisher-info.html
If using a CDN:
- Ensure the .well-known path is not cached
- Configure proper headers at the CDN level
- Test with and without CDN
After implementing IPTC Publisher Info:
/.well-known/publisher-info.html OR JSON-LD embedded in website pagesCongratulations! You've successfully implemented IPTC Publisher Info. Your organisation is now part of a global effort to increase transparency and trust in media publishing.