artificial txawj ntseCov ntsiab lus MarketingCov cuab yeej ua lag luam

FastBots: Tsim Kev Cai WordPress XML Sitemap Rau Kev Kawm Koj AI Bot

Martech Zone muaj ntau txhiab kab lus, nrog ntau ntawm lawv outdated. Kuv tau ua haujlwm ntawm lub xaib tau ntau xyoo los tshem tawm lossis hloov kho ntau pua cov ntawv, tab sis kuv tseem muaj ntau ntxiv. Nyob rau tib lub sijhawm, kuv xav cob qhia ib hom lus bot nrog kuv cov ntsiab lus, tab sis qhov kawg kuv xav ua yog cob qhia nws ntawm cov ntawv tshaj tawm.

FastBots yog ib tug Sib tham GPT-powered bot builder uas koj tuaj yeem pib qhia siv koj daim ntawv qhia chaw (lossis lwm yam kev xaiv). Kuv xav tau daim ntawv qhia chaw lim dej uas suav tag nrho cov ntawv hloov kho txij li hnub tshwj xeeb. Tsis tas li ntawd, kuv xav suav nrog kuv nplooj ntawv thiab cov ntawv acrony (ib hom kev cai tshaj tawm). Kuv tsis xav kom suav nrog cov nplooj ntawv khaws tseg rau pawg thiab cov cim npe lossis muaj kuv lub tsev nplooj ntawv vim nws tseem yog archive.

Siv cov cai kuv muab rau hauv qhov kawg ntawm tsab xov xwm no; Kuv tsim ib qho kev cai WordPress plugin uas tsim kev cai XML sitemap uas dynamically refreshes txhua zaus kuv tshaj tawm ib tug ncej. FastBots tsis muaj txoj hauv kev automated retraining raws li kuv tshaj tawm txhua tsab xov xwm, tab sis qhov no yog qhov pib zoo rau kev siv lub platform.

Lub sitemap imports tag nrho cov txuas mus cob qhia AI Bot ntawm:

FastBots: Qhia bot los ntawm koj lub vev xaib sitemap.

Tag nrho cov nplooj ntawv tam sim no raug xa mus, thiab koj tuaj yeem cob qhia koj bot ntawm cov ntaub ntawv siv tau. Koj kuj muaj sijhawm los tshem tawm cov nplooj ntawv tshwj xeeb. FastBots kuj tau tso cai rau kuv hloov kho kuv tus AI bot lub npe thiab txawm tias muaj qhov txuas mus rau ib tsab xov xwm cuam tshuam hauv kuv cov lus teb. Kuj tseem muaj kev thov ua tus thawj coj ua rau hauv lub platform.

Lub platform ua haujlwm flawlessly… koj tuaj yeem muab kuv tus bot sim tsav ntawm no:

Tua tawm Martech Zone's Bot, Marty Tsim koj FastBots AI Bot

Custom XML Sitemap

Es tsis ntxiv qhov kev ua haujlwm no rau kuv lub ntsiab lus, kuv tau tsim kev cai WordPress plugin los tsim ib lub Sitemap. Tsuas yog ntxiv cov npe hauv koj lub plugins folder, ces a PHP file nrog cov cai hauv qab no:

<?php
/*
Plugin Name: Bot Sitemap
Description: Dynamically generates an XML sitemap including posts modified since a specific date and updates it when a new article is added.
Version: 1.0
Author: Your Name
*/

// Define the date since when to include modified posts (format: Y-m-d)
$mtz_modified_since_date = '2020-01-01';

// Register the function to update the sitemap when a post is published
add_action('publish_post', 'mtz_update_sitemap_on_publish');

// Function to update the sitemap
function mtz_update_sitemap_on_publish($post_id) {
    // Check if the post is not an auto-draft
    if (get_post_status($post_id) != 'auto-draft') {
        mtz_build_dynamic_sitemap();
    }
}

// Main function to build the sitemap
function build_bot_sitemap() {
    global $mtz_modified_since_date;

    $args = array(
        'post_type' => 'post',
        'date_query' => array(
            'column' => 'post_modified',
            'after'  => $mtz_modified_since_date
        ),
        'posts_per_page' => -1 // Retrieve all matching posts
    );

    $postsForSitemap = get_posts($args);

    // Fetch all 'acronym' custom post type posts
    $acronymPosts = get_posts(array(
        'post_type' => 'acronym',
        'posts_per_page' => -1,
    ));

    // Fetch all pages except the home page
    $pagesForSitemap = get_pages();
    $home_page_id = get_option('page_on_front');

    $sitemap = '<?xml version="1.0" encoding="UTF-8"?>';
    $sitemap .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';

    foreach($postsForSitemap as $post) {
        setup_postdata($post);
        if ($post->ID != $home_page_id) {
            $sitemap .= '<url>'.
                          '<loc>'. get_permalink($post) .'</loc>'.
                          '<lastmod>'. get_the_modified_date('c', $post) .'</lastmod>'.
                          '<changefreq>weekly</changefreq>'.
                        '</url>';
        }
    }

    foreach($acronymPosts as $post) {
        setup_postdata($post);
        if ($post->ID != $home_page_id) {
            $sitemap .= '<url>'.
                          '<loc>'. get_permalink($post) .'</loc>'.
                          '<lastmod>'. get_the_modified_date('c', $post) .'</lastmod>'.
                          '<changefreq>weekly</changefreq>'.
                        '</url>';
        }
    }

    foreach($pagesForSitemap as $page) {
        setup_postdata($page);
        if ($page->ID != $home_page_id) {
            $sitemap .= '<url>'.
                          '<loc>'. get_permalink($page) .'</loc>'.
                          '<lastmod>'. get_the_modified_date('c', $page) .'</lastmod>'.
                          '<changefreq>monthly</changefreq>'.
                        '</url>';
        }
    }

    wp_reset_postdata();

    $sitemap .= '</urlset>';

    file_put_contents(get_home_path().'bot-sitemap.xml', $sitemap);
}

// Activate the initial sitemap build on plugin activation
register_activation_hook(__FILE__, 'build_bot_sitemap');

Douglas Karr

Douglas Karr yog CMO OpenINSIGHTS thiab tus founder ntawm lub Martech Zone. Douglas tau pab ntau ntau qhov kev vam meej MarTech startups, tau pab nyob rau hauv kev mob siab rau ntau tshaj $ 5 bil nyob rau hauv Martech nrhiav thiab kev nqis peev, thiab txuas ntxiv pab cov tuam txhab hauv kev siv thiab automating lawv cov kev muag khoom thiab kev lag luam cov tswv yim. Douglas yog tus paub thoob ntiaj teb kev hloov pauv digital thiab MarTech kws tshaj lij thiab hais lus. Douglas tseem yog tus sau phau ntawv Dummie phau ntawv qhia thiab phau ntawv ua lag luam.

lwm yam khoom

Rov qab mus rau sab saum toj
Close

Adblock nrhiav tau

Martech Zone muaj peev xwm muab cov ntsiab lus no rau koj yam tsis muaj nqi vim tias peb tau txais peb lub vev xaib los ntawm kev tshaj tawm cov nyiaj tau los, koom nrog kev sib txuas, thiab kev txhawb nqa. Peb yuav txaus siab yog tias koj yuav tshem koj cov ad blocker thaum koj saib peb lub xaib.