Tambah Panganan Podcast Eksternal menyang Panganan Situs WordPress Sampeyan

Fungsi Panganan Podcast WordPress

Podcast online sing populer digunakake WordPress minangka platform penerbitan kanggo informasi babagan podcast uga nerbitake ton informasi babagan saben pertunjukan. Nanging, dheweke pancen dadi podcast ing mesin hosting podcast eksternal. Iki apik banget kanggo para pengunjung situs - nanging ora ana siji fitur sing ora bisa dideleng pangguna nanging katon kaya crawler kaya Google.

Google nemtokake iki ing dhukungan:

Kajaba iku, yen sampeyan nggandhengake feed RSS karo homepage, pangguna sing nggoleki podcast kanthi jeneng bisa entuk katrangan podcast uga episode carousel kanggo acara ing Google Search. Yen sampeyan ora nyedhiyakake homepage sing gegandhengan, utawa Google ora bisa ngramal homepage, episode isih bisa ditampilake ing asil Telusuran Google, nanging mung diklompokake karo episode saka podcast liyane kanthi topik sing padha.

Google - Entuk podcast sampeyan ing Google

 Kanthi loro sing digandhengake, sampeyan bisa entuk jangkoan apik ing Google:

Podcast ing Google SERP

Nyusup situs kasebut mbukak feed postingan blog, nanging ora nyata feed podcast - sing dadi tuan rumah eksternal. Perusahaan pengin njaga feed blog sing saiki, mula kita pengin nambah feed tambahan menyang situs kasebut. Mangkene carane:

  1. Kita kudu kode a feed anyar ing tema WordPress.
  2. Kita kudu njupuk lan nerbitake feed podcast eksternal ing feed anyar.
  3. Kita kudu nambah link ing sirah situs WordPress sing nampilake URL feed anyar.
  4. Bonus: Kita kudu ngresiki URL feed podcast anyar supaya ora kudu gumantung karo querystrings lan bisa nulis maneh dalane ing URL sing apik.

Cara Nambah Umpan Anyar menyang WordPress

Ing tema utawa file fungsi.php tema (disaranake) bocah, sampeyan kudu nambah feed anyar lan menehi katrangan marang WordPress babagan cara nggawe. Siji cathetan iki… bakal nerbitake feed anyar ing https://yoursite.com/?feed=podcast

function add_podcast_feed() {
    add_feed( 'podcast', 'render_podcast_feed' );
}
add_action( 'init', 'add_podcast_feed' );

Goleki Panganan Podcast Eksternal lan Terbitake ing Umpan WordPress

Kita ngandhani WordPress yen bakal nggawe podcast nggunakake render_podcast_feed, mula saiki kita pengin njupuk feed eksternal (sing ditunjuk dadi https: //yourexternalpodcast.com/feed/ ing fungsi ing ngisor iki lan duplikat ing WordPress nalika panjaluk. Siji cathetan… WordPress bakal cache respon.

function render_podcast_feed() {
    header( 'Content-Type: application/rss+xml' );
    $podcast = 'https://yourexternalpodcast.com/feed/';
    
    $response = wp_remote_get( $podcast );
        try {
            $podcast_feed = $response['body'];

        } catch ( Exception $ex ) {
            $podcast_feed = null;
        } // end try/catch
 
    echo $podcast_feed;
} 

Tulis maneh Umpan Anyar Sampeyan menyang URL sing Apik

Mangkene sawetara bonus. Elinga kepiye feed diterbitake nganggo querystring? Kita bisa nambah aturan nulis ulang fungsi.php kanggo ngganti URL sing apik:

function podcast_feed_rewrite( $wp_rewrite ) {
    $feed_rules = array(
        'feed/podcast/' => 'index.php?feed=podcast'
    );

    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
add_filter( 'generate_rewrite_rules', 'podcast_feed_rewrite' );

Saiki, feed anyar diterbitake ing https://yoursite.com/feed/podcast/

Tambahake Link menyang Panganan ing Kepala

Langkah pungkasan yaiku sampeyan pengin nambah link ing label utama situs WordPress supaya crawler bisa nemokake. Ing kasus iki, kita malah pengin milih feed minangka dhaptar sing pertama (ing ndhuwur blog lan feed komentar), mula kita nambah prioritas 1. Sampeyan uga pengin nganyari judhul ing tautan lan priksa manawa ora ana ora cocog karo judhul feed liyane ing situs iki:

function add_podcast_link_head() {
    $podcast_link = site_url().'/feed/podcast/';
    ?>
    <link rel="alternate" type="application/rss+xml" title="My Podcast Name" href="<?php echo $podcast_link; ?>"/>
    <?php
}
add_action('wp_head', 'add_podcast_link_head', 1);

Umpan Podcast WordPress Anyar Sampeyan

Cara sing apik kanggo metode iki yaiku kita bisa nyandhang kabeh pangowahan ing tema situs… ora ana file template tambahan utawa nyunting header, lsp. Sawetara rincian penting:

  • Permalinks - Sawise sampeyan nambahake kode menyang functions.php, sampeyan kudu mbukak Setelan> Permalinks ing admin WordPress. Sing bakal nyegerake aturan permalink sampeyan supaya kode sing ditambahake kanggo nulis ulang saiki wis diterapake.
  • keamanan - Yen situs sampeyan SSL lan feed podcast ora, sampeyan bakal nemoni masalah keamanan campuran. Aku nyaranake supaya situs lan hosting podcast sampeyan dadi host sing aman (ing https alamat tanpa kesalahan).
  • Sindikasi - Aku nyaranake nggunakake feed podcast khusus domain iki kanggo sindikasi menyang Google, Apple, Spotify lan layanan liyane. Keuntungan ing kene yaiku saiki sampeyan bisa ngganti host podcast nalika pengin lan ora kudu nganyari feed sumber saben layanan.
  • Analytics - Aku nyaranake duwe layanan kaya Panganan ing ngendi sampeyan bisa ngatur feed lan entuk sawetara trek terpusat sing digunakake ngluwihi layanan sing diwenehake. FeedPress uga ngidini sampeyan kanthi otomatis nerbitake menyang saluran sosial, fitur sing apik banget!

Pengin weruh apa wis sukses? Sampeyan bisa nggunakake Validator Pakan Cast kanggo verifikasi feed!

3 Komentar

  1. 1

    Sampeyan butuh 2 1/2 dina nggoleki jaring kanggo nemokake apa-apa sing dakkarepake saben podcast WordPress - dadi tuan rumah RSS feed kanggo podcast sing di-host pihak katelu ing situs wordpress.

    Matur nuwun! Mesthi wae artikel sampeyan takon: kenapa iki plugin WordPress? Sing paling cedhak sing ditemokake yaiku WP RSS Aggregator, nanging kabeh nulis ulang XML lan ngrusak RSS.

  2. 2

    Hi
    Aku wis nyiyapake situs WordPress kanggo nerbitake maneh RSS persis kaya sing dituduhake, lan bisa mlaku, luwih becik ngontrol dhewe lan njupuk langkah gedhe saka proses podcasting.

    Nanging aku duwe pitakon, amarga cara host podcasting ngasilake XML RSS - ngasilake link web kanthi otomatis kanggo saben episode sing nuduhake kaca HTML ing situs web freebie host podcasting sing ora digunakake.

    Tuladhane <rss2><channel><item><link></link> yen markdown bisa digunakake. Utawa "rss2> saluran> item> link"

    Apple Podcast nggunakake data XML iki kanggo nampilake tautan gedhe ing kaca kanggo saben episode. Nanging aku ora nggunakake situs web freebie kasebut saka host podcasting (Podbeans). Aku kudu ngarahake situs webku dhewe - ing endi feed RSS sing aku kontrol dadi host.

    Apa sampeyan mikir bisa ngapusi XML mlebu kanggo ngganti tautan saka podbeans.com menyang my-website.com?

    • 3

      Sampeyan bisa nindakake iki, nanging sampeyan uga kudu nulis kode kanggo njaluk file sing dadi host nyata (kaya MP3). Aku sejatine ora bakal nindakake iki amarga umume host web ora dioptimalake kanggo ndownload file gedhe sing dibutuhake karo podcast.

Apa sampeyan mikir?

Situs iki nggunakake Akismet kanggo ngurangi spam. Sinau babagan proses data sampeyan.