Social Meta

Social Meta Tags Generator

Social Meta Tags Generator

Generator
Social Previews
Meta Tags Code
Recommended: 50-60 characters
Recommended: 150-160 characters
Recommended size: 1200×630 pixels (Facebook), 800×418 (Twitter)
`; document.getElementById('vue-code').querySelector('code').textContent = vueCode; // WordPress code let wordpressCode = `/** * Add this code to your theme's functions.php file * or in a custom plugin */ function add_social_meta_tags() { if (is_single() || is_page()) { // Get post/page data $title = get_the_title(); $description = get_the_excerpt(); $url = get_permalink(); $image = get_the_post_thumbnail_url(); // Fallback image if (!$image) { $image = '${escapedImage}'; } ?> `; if (twitterHandle) { wordpressCode += ` `; } wordpressCode += ` { alert('Code copied to clipboard!'); }).catch(err => { console.error('Failed to copy:', err); showError('Failed to copy to clipboard'); }); } function showError(message) { const errorElement = document.getElementById('error-message'); errorElement.textContent = message; errorElement.style.display = 'block'; } function hideError() { document.getElementById('error-message').style.display = 'none'; }